军团:邀请不可以请不同服的人

This commit is contained in:
luying
2021-10-19 18:50:01 +08:00
parent 48d86f30a5
commit ee91d70bf5
2 changed files with 6 additions and 1 deletions

View File

@@ -422,7 +422,7 @@ export class GuildHandler {
let result = new Array<string>();
let uids = [];
for (let role of roleList) {
if (!role.hasGuild) {
if (!role.hasGuild || role.serverId == serverId) {
await UserGuildApplyModel.createUserGuildApply(role, guild, GUILD_APPLY_TYPE.INVITE);
result.push(role.roleId);
let hisInfo = await getRoleOnlineInfo(role.roleId);
@@ -431,6 +431,10 @@ export class GuildHandler {
}
}
}
if(result.length <= 0) {
return resResult(STATUS.GUILD_CANNOT_INVITE)
}
await GuildModel.recordInvitedMember(code, serverId, roleIds, shouldRefresh(guild.inviteTime, new Date()));
this.channelService.pushMessageByUids('onGuildInvite', resResult(STATUS.SUCCESS, { code }), uids);