From 609192b516cda779b8a7316f7874c2c730e569c2 Mon Sep 17 00:00:00 2001 From: zjz1993 <1429595365@qq.com> Date: Mon, 12 Aug 2019 13:55:55 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=E8=AE=BA=E5=9D=9B=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=9B=9E=E5=A4=8D=E5=9B=9E=E5=A4=8D=E7=9A=84=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models-built/reply.js | 71 +++++++++++++++++++++++++++++ models-built/reply.js.map | 1 + models/reply.ts | 35 ++++++++++++++ modules/discussion.js | 89 ++++++++++++++++++++++++++++++++++-- views/article.ejs | 96 +++++++++++++++++++++++++++++++++++---- 5 files changed, 281 insertions(+), 11 deletions(-) create mode 100644 models-built/reply.js create mode 100644 models-built/reply.js.map create mode 100644 models/reply.ts diff --git a/models-built/reply.js b/models-built/reply.js new file mode 100644 index 0000000..7ba6636 --- /dev/null +++ b/models-built/reply.js @@ -0,0 +1,71 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +exports.__esModule = true; +var TypeORM = require("typeorm"); +var common_1 = require("./common"); +var Reply = /** @class */ (function (_super) { + __extends(Reply, _super); + function Reply() { + return _super !== null && _super.apply(this, arguments) || this; + } + Reply.cache = false; + __decorate([ + TypeORM.PrimaryGeneratedColumn(), + __metadata("design:type", Number) + ], Reply.prototype, "id"); + __decorate([ + TypeORM.Column({ nullable: true, type: "mediumtext" }), + __metadata("design:type", String) + ], Reply.prototype, "content"); + __decorate([ + TypeORM.Index(), + TypeORM.Column({ nullable: true, type: "integer" }), + __metadata("design:type", Number) + ], Reply.prototype, "user_id"); + __decorate([ + TypeORM.Index(), + TypeORM.Column({ nullable: true, type: "integer" }), + __metadata("design:type", Number) + ], Reply.prototype, "comment_id"); + __decorate([ + TypeORM.Index(), + TypeORM.Column({ nullable: true, type: "integer" }), + __metadata("design:type", Number) + ], Reply.prototype, "article_id"); + __decorate([ + TypeORM.Column({ nullable: true, type: "integer" }), + __metadata("design:type", Number) + ], Reply.prototype, "public_time"); + __decorate([ + TypeORM.Column({ nullable: true, type: "integer" }), + __metadata("design:type", Number) + ], Reply.prototype, "update_time"); + Reply = __decorate([ + TypeORM.Entity() + ], Reply); + return Reply; +}(common_1["default"])); +exports["default"] = Reply; +; +//# sourceMappingURL=reply.js.map \ No newline at end of file diff --git a/models-built/reply.js.map b/models-built/reply.js.map new file mode 100644 index 0000000..7526ae4 --- /dev/null +++ b/models-built/reply.js.map @@ -0,0 +1 @@ +{"version":3,"file":"reply.js","sourceRoot":"","sources":["../models/reply.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAAmC;AACnC,mCAA6B;AAO7B;IAAmC,yBAAK;IAAxC;;IA0BA,CAAC;IAzBU,WAAK,GAAG,KAAK,CAAC;IAGrB;QADC,OAAO,CAAC,sBAAsB,EAAE;;6BACtB;IAGX;QADC,OAAO,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;;kCACvC;IAIhB;QAFC,OAAO,CAAC,KAAK,EAAE;QACf,OAAO,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;kCACpC;IAIhB;QAFC,OAAO,CAAC,KAAK,EAAE;QACf,OAAO,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;qCACjC;IAInB;QAFC,OAAO,CAAC,KAAK,EAAE;QACf,OAAO,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;qCACjC;IAGnB;QADC,OAAO,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;sCAChC;IAGpB;QADC,OAAO,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;sCAChC;IAzBH,KAAK;QADzB,OAAO,CAAC,MAAM,EAAE;OACI,KAAK,CA0BzB;IAAD,YAAC;CAAA,AA1BD,CAAmC,mBAAK,GA0BvC;qBA1BoB,KAAK;AA0BzB,CAAC"} \ No newline at end of file diff --git a/models/reply.ts b/models/reply.ts new file mode 100644 index 0000000..a96f386 --- /dev/null +++ b/models/reply.ts @@ -0,0 +1,35 @@ +import * as TypeORM from "typeorm"; +import Model from "./common"; +import User from "./user"; +import Article from "./article"; + +declare var syzoj: any; + +@TypeORM.Entity() +export default class Reply extends Model { + static cache = false; + + @TypeORM.PrimaryGeneratedColumn() + id: number; + + @TypeORM.Column({ nullable: true, type: "mediumtext" }) + content: string; + + @TypeORM.Index() + @TypeORM.Column({ nullable: true, type: "integer" }) + user_id: number; + + @TypeORM.Index() + @TypeORM.Column({ nullable: true, type: "integer" }) + comment_id: number; + + @TypeORM.Index() + @TypeORM.Column({ nullable: true, type: "integer" }) + article_id: number; + + @TypeORM.Column({ nullable: true, type: "integer" }) + public_time: number; + + @TypeORM.Column({ nullable: true, type: "integer" }) + update_time: number; +}; diff --git a/modules/discussion.js b/modules/discussion.js index cd208f2..028d25d 100644 --- a/modules/discussion.js +++ b/modules/discussion.js @@ -2,6 +2,7 @@ let Problem = syzoj.model('problem'); let Article = syzoj.model('article'); let ArticleComment = syzoj.model('article-comment'); let User = syzoj.model('user'); +let Reply = syzoj.model('reply'); app.get('/discussion/:type?', async (req, res) => { try { @@ -76,6 +77,7 @@ app.get('/discussion/problem/:pid', async (req, res) => { app.get('/article/:id', async (req, res) => { try { let id = parseInt(req.params.id); + let replyQuery = await Reply.createQueryBuilder(); let article = await Article.findById(id); if (!article) throw new ErrorMessage('无此帖子。'); @@ -93,6 +95,17 @@ app.get('/article/:id', async (req, res) => { }); for (let comment of comments) { + const commentId = comment.id; + const reply = await replyQuery.where("comment_id = :commentId", { commentId }).getMany(); + if (reply.length === 0) { + comment.reply = []; + } else { + comment.reply = await reply.mapAsync(async (item) => { + const replyUserId = item.user_id; + item.reply_user = await User.findById(replyUserId); + return item + }); + } comment.content = await syzoj.utils.markdown(comment.content); comment.allowedEdit = await comment.isAllowedEditBy(res.locals.user); await comment.loadRelationships(); @@ -105,8 +118,8 @@ app.get('/article/:id', async (req, res) => { throw new ErrorMessage('您没有权限进行此操作。'); } } - res.render('article', { + user: res.locals.user, article: article, comments: comments, paginate: paginate, @@ -203,7 +216,11 @@ app.post('/article/:id/delete', async (req, res) => { await Promise.all((await ArticleComment.find({ article_id: article.id - })).map(comment => comment.destroy())) + })).map(comment => comment.destroy())); + + await Promise.all((await Reply.find({ + article_id: article.id + })).map(reply => reply.destroy())); await article.destroy(); @@ -249,13 +266,55 @@ app.post('/article/:id/comment', async (req, res) => { } }); +app.post('/article/:id/comment/:commentId', async (req, res) => { + try { + if (!res.locals.user) throw new ErrorMessage('请登录后继续。', { '登录': syzoj.utils.makeUrl(['login'], { 'url': req.originalUrl }) }); + + let id = parseInt(req.params.id); + let commentId = parseInt(req.params.commentId); + let userId = parseInt(res.locals.user.id); + let article = await Article.findById(id); + let articleComment = await ArticleComment.findById(commentId); + + if (!articleComment) { + throw new ErrorMessage('无此回复。'); + } + + if (!article) { + throw new ErrorMessage('无此帖子。'); + } else { + if (!await article.isAllowedCommentBy(res.locals.user)) throw new ErrorMessage('您没有权限进行此操作。'); + } + + let newReply = await Reply.create({ + content: req.body.comment, + article_id: id, + user_id: userId, + comment_id: commentId, + public_time: syzoj.utils.getCurrentDate(), + update_time: syzoj.utils.getCurrentDate() + }); + + const reply = await newReply.save(); + + await article.resetReplyCountAndTime(); + // + res.redirect(syzoj.utils.makeUrl(['article', article.id])); + } catch (e) { + syzoj.log(e); + res.render('error', { + err: e + }); + } +}); + app.post('/article/:article_id/comment/:id/delete', async (req, res) => { try { if (!res.locals.user) throw new ErrorMessage('请登录后继续。', { '登录': syzoj.utils.makeUrl(['login'], { 'url': req.originalUrl }) }); let id = parseInt(req.params.id); let comment = await ArticleComment.findById(id); - + let replyQuery = await Reply.createQueryBuilder(); if (!comment) { throw new ErrorMessage('无此评论。'); } else { @@ -265,6 +324,7 @@ app.post('/article/:article_id/comment/:id/delete', async (req, res) => { const article = await Article.findById(comment.article_id); await comment.destroy(); + await replyQuery.delete().from(Reply).where("comment_id = :id", { id }).execute(); await article.resetReplyCountAndTime(); @@ -276,3 +336,26 @@ app.post('/article/:article_id/comment/:id/delete', async (req, res) => { }); } }); + +app.post('/article/:articleId/reply/:id/delete', async (req, res) => { + try { + if (!res.locals.user) throw new ErrorMessage('请登录后继续。', { '登录': syzoj.utils.makeUrl(['login'], { 'url': req.originalUrl }) }); + + let id = parseInt(req.params.id); + let reply = await Reply.findById(id); + let articleId = parseInt(req.params.articleId); + let replyQuery = await Reply.createQueryBuilder(); + if (!reply) { + throw new ErrorMessage('无此回复。'); + } + + await reply.destroy(); + + res.redirect(`/article/${articleId}`); + } catch (e) { + syzoj.log(e); + res.render('error', { + err: e + }); + } +}); diff --git a/views/article.ejs b/views/article.ejs index 3386e33..2b2a7a3 100644 --- a/views/article.ejs +++ b/views/article.ejs @@ -4,6 +4,18 @@ .small{ font-size: 0.7em; } +.reply{ + margin-left: 45px !important; +} +.article-comment{ + cursor: pointer; + display: inline-block; + margin: 0 .75em 0 0; + color: rgba(0,0,0,.4); +} +.article-comment:hover{ + color: rgba(0,0,0,.8); +}
+

<%= article.title %>

<%= article.user.username %><% if (article.user.nameplate) { %><%- article.user.nameplate %><% } %> <%= syzoj.utils.formatDate(article.public_time) %> + <% if(user) {%> + 回复 + <%}%> <% if (article.public_time !== article.update_time) { %> <%= syzoj.utils.formatDate(article.update_time) %><% } %> <% if (article.allowedEdit) { %> 编辑 @@ -65,14 +81,14 @@

<%- comment.content %>
<% if (comment.allowedEdit) { %> -
删除
+
删除回复
- <% } %> + <% for (let reply of comment.reply) { %> +
+ + + +
+ <%= reply.reply_user.username %><% if (reply.reply_user.nameplate) { %><%- reply.reply_user.nameplate %><% } %> + +
<%- reply.content %>
+ <% if (comment.allowedEdit) { %> + + + <% } %> +
+
+ <% } %> + <% } %>
<% include page %> @@ -96,14 +154,14 @@ <% } %> <% if (article.allowedComment) { %> <% include monaco-editor %> -
+
<%- this.showLoadingEditor(); %>
@@ -111,7 +169,7 @@ var editors = { comment: { defaultValue: '' } }; - + window.onEditorLoaded(function () { for (var name in editors) { var editor = editors[name]; @@ -122,7 +180,29 @@ $('#submit_button').removeClass('disabled'); }); - + <% } %>
<% include footer %> + From 53b628e935b1875b017028f9b98d74b6a8795091 Mon Sep 17 00:00:00 2001 From: zjz1993 <1429595365@qq.com> Date: Tue, 13 Aug 2019 11:36:51 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat:=E7=BB=99=E6=99=AE=E9=80=9A=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E5=A2=9E=E5=8A=A0=E5=8C=BF=E5=90=8D=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libs/submissions_process.js | 3 ++- models-built/judge_state.js | 5 +++++ models-built/judge_state.js.map | 2 +- models-built/user.js | 4 ++++ models-built/user.js.map | 2 +- models/judge_state.ts | 4 ++++ models/user.ts | 3 +++ modules/api.js | 9 ++++++++- modules/index.js | 12 ++++++++++-- modules/problem.js | 8 +++++--- modules/submission.js | 10 +++++++++- modules/user.js | 15 +++++++++------ views/problem.ejs | 18 ++++++++++++++++-- views/submissions_item.ejs | 6 +++++- views/user_edit.ejs | 4 ++++ 15 files changed, 86 insertions(+), 19 deletions(-) diff --git a/libs/submissions_process.js b/libs/submissions_process.js index d20afc4..c18a932 100644 --- a/libs/submissions_process.js +++ b/libs/submissions_process.js @@ -14,7 +14,8 @@ const getSubmissionInfo = (s, displayConfig) => { submitTime: syzoj.utils.formatDate(s.submit_time), isPractice: s.is_practice, c_id: s.c_id, - is_share: s.is_share || false + is_share: s.is_share || false, + is_anonymous: s.is_anonymous } }; diff --git a/models-built/judge_state.js b/models-built/judge_state.js index 1afe4a4..8d733cb 100644 --- a/models-built/judge_state.js +++ b/models-built/judge_state.js @@ -372,6 +372,11 @@ var JudgeState = /** @class */ (function (_super) { TypeORM.Column({ nullable: true, type: "boolean" }), __metadata("design:type", Boolean) ], JudgeState.prototype, "is_share"); + __decorate([ + TypeORM.Index(), + TypeORM.Column({ nullable: true, type: "boolean", "default": 0 }), + __metadata("design:type", Boolean) + ], JudgeState.prototype, "is_anonymous"); JudgeState = __decorate([ TypeORM.Entity(), TypeORM.Index(['type', 'type_info']), diff --git a/models-built/judge_state.js.map b/models-built/judge_state.js.map index 19146cf..2b43ca2 100644 --- a/models-built/judge_state.js.map +++ b/models-built/judge_state.js.map @@ -1 +1 @@ -{"version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AAE,CAAC;;yCAClC;IAIlB;QAFC,OAAO,CAAC,KAAK,EAAE;QACf,OAAO,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;yCACjC;IAInB;QAFC,OAAO,CAAC,KAAK,EAAE;QACf,OAAO,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;wCACnC;IAIjB;QAFC,OAAO,CAAC,KAAK,EAAE;QACf,OAAO,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,SAAO,EAAE,CAAC,EAAE,CAAC;;4CAC3C;IA1EF,UAAU;QAP9B,OAAO,CAAC,MAAM,EAAE;QAChB,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;QACpC,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC;QACxE,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC;QAC5D,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,WAAW,EAAE,YAAY,CAAC,CAAC;QAClD,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,YAAY,CAAC,CAAC;QAC9D,OAAO,CAAC,KAAK,CAAC,CAAC,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;OACrC,UAAU,CA4K9B;IAAD,iBAAC;CAAA,AA5KD,CAAwC,mBAAK,GA4K5C;qBA5KoB,UAAU"} \ No newline at end of file diff --git a/models-built/user.js b/models-built/user.js index 24ec427..77fe64c 100644 --- a/models-built/user.js +++ b/models-built/user.js @@ -360,6 +360,10 @@ var User = /** @class */ (function (_super) { TypeORM.Column({ nullable: true, type: "varchar", length: 80 }), __metadata("design:type", String) ], User.prototype, "username"); + __decorate([ + TypeORM.Column({ nullable: true, type: "varchar", length: 60, "default": '' }), + __metadata("design:type", String) + ], User.prototype, "anonymous_name"); __decorate([ TypeORM.Column({ nullable: true, type: "varchar", length: 120 }), __metadata("design:type", String) diff --git a/models-built/user.js.map b/models-built/user.js.map index a5403cd..51f5858 100644 --- a/models-built/user.js.map +++ b/models-built/user.js.map @@ -1 +1 @@ -{"version":3,"file":"user.js","sourceRoot":"","sources":["../models/user.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAAmC;AACnC,mCAA6B;AAI7B,6CAAuC;AACvC,mDAA6C;AAC7C,qCAAgC;AAGhC;IAAkC,wBAAK;IAAvC;;IAwMA,CAAC;aAxMoB,IAAI;IA2DV,cAAS,GAAtB,UAAuB,KAAK;;;gBAC1B,sBAAO,MAAI,CAAC,OAAO,CAAC;wBAClB,KAAK,EAAE;4BACL,KAAK,EAAE,KAAK;yBACb;qBACF,CAAC,EAAC;;;KACJ;IAEY,aAAQ,GAArB,UAAsB,IAAI;;;gBACxB,sBAAO,MAAI,CAAC,OAAO,CAAC;wBAClB,KAAK,EAAE;4BACL,QAAQ,EAAE,IAAI;yBACf;qBACF,CAAC,EAAC;;;KACJ;IAEK,8BAAe,GAArB,UAAsB,IAAI;;;;;wBACxB,IAAI,CAAC,IAAI;4BAAE,sBAAO,KAAK,EAAC;wBACpB,qBAAM,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,EAAA;;wBAA1C,IAAI,SAAsC;4BAAE,sBAAO,IAAI,EAAC;wBACxD,sBAAO,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC,EAAC;;;;KACvD;IAED,2CAA4B,GAA5B;QACE,OAAO,wBAAU,CAAC,kBAAkB,E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AAS,EAAE,SAAO,EAAE,IAAI,EAAE,CAAC;;sCAC7C;IAGtB;QADC,OAAO,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,SAAO,EAAE,IAAI,EAAE,CAAC;;+CACpC;IAG/B;QADC,OAAO,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;6BACxC;IAGZ;QADC,OAAO,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;gCACrC;IAGf;QADC,OAAO,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;uCAC9B;IA5DH,IAAI;QADxB,OAAO,CAAC,MAAM,EAAE;OACI,IAAI,CA2MxB;IAAD,WAAC;CAAA,AA3MD,CAAkC,mBAAK,GA2MtC;qBA3MoB,IAAI"} \ No newline at end of file diff --git a/models/judge_state.ts b/models/judge_state.ts index 81f7fc7..d5ff7d1 100644 --- a/models/judge_state.ts +++ b/models/judge_state.ts @@ -106,6 +106,10 @@ export default class JudgeState extends Model { @TypeORM.Column({ nullable: true, type: "boolean" }) is_share:boolean; + @TypeORM.Index() + @TypeORM.Column({ nullable: true, type: "boolean", default: 0 }) + is_anonymous:boolean; + user?: User; problem?: Problem; diff --git a/models/user.ts b/models/user.ts index 7f340d0..891c6e8 100644 --- a/models/user.ts +++ b/models/user.ts @@ -18,6 +18,9 @@ export default class User extends Model { @TypeORM.Column({ nullable: true, type: "varchar", length: 80 }) username: string; + @TypeORM.Column({ nullable: true, type: "varchar", length: 60 , default: ''}) + anonymous_name: string; + @TypeORM.Column({ nullable: true, type: "varchar", length: 120 }) email: string; diff --git a/modules/api.js b/modules/api.js index 962f776..fc4c22c 100644 --- a/modules/api.js +++ b/modules/api.js @@ -20,6 +20,12 @@ app.post('/api/login', async (req, res) => { else { req.session.user_id = user.id; setLoginCookie(user.username, user.password, res); + const userQuery = await User.createQueryBuilder(); + const userId = user.id; + const userInfo = await userQuery.where("id = :id", { id:userId }).getOne(); + if (!userInfo.anonymous_name || userInfo.anonymous_name.length === 0){ + await userQuery.update(User).set({anonymous_name: require('randomstring').generate(6)}).where("id = :id", { id:userId }).execute(); + } res.send({ error_code: 1 }); } } catch (e) { @@ -129,7 +135,8 @@ app.post('/api/sign_up', async (req, res) => { email: req.body.email, is_show: syzoj.config.default.user.show, rating: syzoj.config.default.user.rating, - register_time: parseInt((new Date()).getTime() / 1000) + register_time: parseInt((new Date()).getTime() / 1000), + anonymous_name: require('randomstring').generate(6) }); await user.save(); diff --git a/modules/index.js b/modules/index.js index b0ca11b..666fb3f 100644 --- a/modules/index.js +++ b/modules/index.js @@ -16,7 +16,7 @@ app.get('/', async (req, res) => { await ranklist.forEachAsync(async x => x.renderInformation()); let notices = (await Article.find({ - where: { is_notice: true }, + where: { is_notice: true }, order: { public_time: 'DESC' } })).map(article => ({ title: article.title, @@ -40,7 +40,15 @@ app.get('/', async (req, res) => { title: problem.title, time: timeAgo.format(new Date(problem.publicize_time)), })); - + // 增加匿名用户名后用户的第一次登陆 + if (res.locals.user){ + const userQuery = await User.createQueryBuilder(); + const userId = res.locals.user.id; + const userInfo = await userQuery.where("id = :id", { id:userId }).getOne(); + if (!userInfo.anonymous_name || userInfo.anonymous_name.length === 0){ + await userQuery.update(User).set({anonymous_name: require('randomstring').generate(6)}).where("id = :id", { id:userId }).execute(); + } + } res.render('index', { ranklist: ranklist, notices: notices, diff --git a/modules/problem.js b/modules/problem.js index 9934b51..01e172f 100644 --- a/modules/problem.js +++ b/modules/problem.js @@ -669,7 +669,7 @@ app.post('/problem/:id/submit', app.multer.fields([{ name: 'answer', maxCount: 1 let id = parseInt(req.params.id); let problem = await Problem.findById(id); const curUser = res.locals.user; - + const is_anonymous = req.body.is_anonymous ? 1 : 0; if (!problem) throw new ErrorMessage('无此题目。'); if (problem.type !== 'submit-answer' && !syzoj.config.enabled_languages.includes(req.body.language)) throw new ErrorMessage('不支持该语言。'); if (!curUser) throw new ErrorMessage('请登录后继续。', { '登录': syzoj.utils.makeUrl(['login'], { 'url': syzoj.utils.makeUrl(['problem', id]) }) }); @@ -704,7 +704,8 @@ app.post('/problem/:id/submit', app.multer.fields([{ name: 'answer', maxCount: 1 language: null, user_id: curUser.id, problem_id: id, - is_public: problem.is_public + is_public: problem.is_public, + is_anonymous }); } else { let code; @@ -725,7 +726,8 @@ app.post('/problem/:id/submit', app.multer.fields([{ name: 'answer', maxCount: 1 language: req.body.language, user_id: curUser.id, problem_id: id, - is_public: problem.is_public + is_public: problem.is_public, + is_anonymous }); } diff --git a/modules/submission.js b/modules/submission.js index f916f5c..93e4f72 100644 --- a/modules/submission.js +++ b/modules/submission.js @@ -140,6 +140,9 @@ app.get('/submissions', async (req, res) => { info.isPractice = true; info.c_id = practiceInfo.c_id; } + let userQuery = await User.createQueryBuilder(); + const userInfo = await userQuery.where("id = :id", { id:x.user_id }).getOne(); + info.anonymous_name = userInfo.anonymous_name return { info, token: (x.pending && x.task_id != null) ? jwt.sign({ @@ -286,8 +289,13 @@ app.get('/submission/:id', async (req, res) => { } else { judge.code = "作者没有开放此题代码,请联系作者分享。"; } + let info = getSubmissionInfo(judge, currentConfig); + let userQuery = await User.createQueryBuilder(); + const userInfo = await userQuery.where("id = :id", { id:judge.user_id }).getOne(); + console.log(userInfo); + info.anonymous_name = userInfo.anonymous_name res.render('submission', { - info: getSubmissionInfo(judge, currentConfig), + info, roughResult: getRoughResult(judge, currentConfig, false), code: judge.code, formattedCode: judge.formattedCode ? judge.formattedCode.toString("utf8") : null, diff --git a/modules/user.js b/modules/user.js index 180ec83..a719338 100644 --- a/modules/user.js +++ b/modules/user.js @@ -125,20 +125,22 @@ app.get('/user/:id', async (req, res) => { app.get('/user/:id/edit', async (req, res) => { try { let id = parseInt(req.params.id); - let user = await User.findById(id); - if (!user) throw new ErrorMessage('无此用户。'); + let userQuery = await User.createQueryBuilder(); + const userInfo = await userQuery.where("id = :id", { id }).getOne(); + if (!userInfo) throw new ErrorMessage('无此用户。'); - let allowedEdit = await user.isAllowedEditBy(res.locals.user); + let allowedEdit = await userInfo.isAllowedEditBy(res.locals.user); if (!allowedEdit) { throw new ErrorMessage('您没有权限进行此操作。'); } - - user.privileges = await user.getPrivileges(); + + userInfo.privileges = await userInfo.getPrivileges(); + console.log(userInfo); res.locals.user.allowedManage = await res.locals.user.hasPrivilege('manage_user'); res.render('user_edit', { - edited_user: user, + edited_user: userInfo, error_info: null }); } catch (e) { @@ -190,6 +192,7 @@ app.post('/user/:id/edit', async (req, res) => { } user.information = req.body.information; + user.anonymous_name = req.body.anonymous_name || ''; user.sex = req.body.sex; user.public_email = (req.body.public_email === 'on'); user.prefer_formatted_code = (req.body.prefer_formatted_code === 'on'); diff --git a/views/problem.ejs b/views/problem.ejs index 1b29904..fa10af3 100644 --- a/views/problem.ejs +++ b/views/problem.ejs @@ -293,7 +293,15 @@ if (contest) { -
+
+ + <% if (!contest) {%> +
+ + +
+ <% } %> +
<% } else { %> @@ -329,7 +337,13 @@ if (contest) {
- + + <% if (!contest) {%> +
+ + +
+ <% } %>
<% } %> diff --git a/views/submissions_item.ejs b/views/submissions_item.ejs index aba6114..6cbd033 100644 --- a/views/submissions_item.ejs +++ b/views/submissions_item.ejs @@ -120,7 +120,11 @@ <% } %> {{ formatSize(data.info.codeSize, 1) }} - {{ data.info.user }} + + {{ data.info.anonymous_name }} + + {{ data.info.user }} + {{ data.info.submitTime }} > +
+ + +