From 8f8907068d99d5817c11f659223067bfee946bd5 Mon Sep 17 00:00:00 2001 From: Shan Wenxiao Date: Fri, 2 Aug 2024 14:49:06 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E5=85=B3=E9=97=AD=E7=A7=81=E4=BF=A1=E6=8E=A5?= =?UTF-8?q?=E6=94=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Shan Wenxiao --- Source/Process.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Source/Process.ts b/Source/Process.ts index f90d2fe..dcfc76b 100644 --- a/Source/Process.ts +++ b/Source/Process.ts @@ -42,7 +42,8 @@ function sleep(time: number) { } export class Process { - private AdminUserList: Array = ["zhuchenrui2", "shanwenxiao", "shihongxi"]; + private AdminUserList: Array = ["zhuchenrui2", "shanwenxiao"]; + private DenyMessageList: Array = [""]; private DenyBadgeEditList: Array = [""]; private readonly CaptchaSecretKey: string; private GithubImagePAT: string; @@ -195,6 +196,9 @@ export class Process { public IsAdmin = (): boolean => { return this.AdminUserList.indexOf(this.Username) !== -1; } + public DenyMessage = (): boolean => { + return this.DenyMessageList.indexOf(this.Username) !== -1; + } public DenyEdit = (): boolean => { return this.DenyBadgeEditList.indexOf(this.Username) !== -1; } @@ -882,6 +886,9 @@ export class Process { "ToUser": "string", "Content": "string" })); + if (this.DenyMessage()){ + return new Result(false,"该用户已关闭短消息接收"); + } if (Data["Content"].startsWith("您好,我是") && ThrowErrorIfFailed(await this.IfUserExistChecker(Data["ToUser"]))["Exist"] === false) { return new Result(false, "未找到用户"); } From 3f3388a5c2e3d6fd32b16c7acc375bc9a0814688 Mon Sep 17 00:00:00 2001 From: Shan Wenxiao Date: Fri, 2 Aug 2024 17:04:52 +0800 Subject: [PATCH 2/3] Update Database.ts Signed-off-by: Shan Wenxiao --- Source/Database.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Database.ts b/Source/Database.ts index 6ec0d7a..9182a15 100644 --- a/Source/Database.ts +++ b/Source/Database.ts @@ -19,7 +19,7 @@ import {Result, ThrowErrorIfFailed} from "./Result"; import {Output} from "./Output"; import {D1Database} from "@cloudflare/workers-types"; -let readonly = false; //set to true to allow maintenance +let readonly = true; //set to true to allow maintenance export class Database { private RawDatabase: D1Database; From 758a13c10ca08416399695250d1e529f34d0d063 Mon Sep 17 00:00:00 2001 From: Shan Wenxiao Date: Fri, 2 Aug 2024 17:06:09 +0800 Subject: [PATCH 3/3] Update Database.ts Signed-off-by: Shan Wenxiao --- Source/Database.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Database.ts b/Source/Database.ts index 9182a15..6ec0d7a 100644 --- a/Source/Database.ts +++ b/Source/Database.ts @@ -19,7 +19,7 @@ import {Result, ThrowErrorIfFailed} from "./Result"; import {Output} from "./Output"; import {D1Database} from "@cloudflare/workers-types"; -let readonly = true; //set to true to allow maintenance +let readonly = false; //set to true to allow maintenance export class Database { private RawDatabase: D1Database;