军团:限制重名

This commit is contained in:
luying
2021-09-10 17:43:43 +08:00
parent cec130b7c4
commit ed1e5d1635
2 changed files with 9 additions and 2 deletions

View File

@@ -121,9 +121,16 @@ export class GuildHandler {
const roleId = session.get('roleId');
const roleName = session.get('roleName');
const serverId = session.get('serverId');
const { code, name, notice, introduce, ceLimit, isAuto, icon } = msg;
if (!code) return resResult(STATUS.WRONG_PARMS);
// 检查名字是否重
if(name != undefined) {
const checkNameResult = await GuildModel.checkName(name, serverId);
if (checkNameResult) return resResult(STATUS.GUILD_NAME_DUP);
}
const select = ['code', 'name', 'notice', 'introduce', 'ceLimit', 'isAuto', 'icon'];
let updateInfo: GuildUpdateParam = {};
if(name != undefined) updateInfo.name = name;