From 524ed6d05e2dac76caf1b8a4bd300c40fb56c9c7 Mon Sep 17 00:00:00 2001 From: luying Date: Fri, 30 Apr 2021 18:02:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=EF=BC=9A=E4=B8=8D=E5=8F=AF?= =?UTF-8?q?=E5=91=BD=E5=90=8D=E7=A9=BA=E6=95=B0=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shared/db/Role.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/shared/db/Role.ts b/shared/db/Role.ts index 2a85dc4fe..89f08152c 100644 --- a/shared/db/Role.ts +++ b/shared/db/Role.ts @@ -627,6 +627,7 @@ export default class Role extends BaseModel { } public static async checkName(roleName: string, serverId: number) { + if(!roleName) return true; // 不可起空字符串 const role: RoleType = await RoleModel.findOne({ roleName, serverId }).lean(); return !!role; }