军团:邮件参数

This commit is contained in:
luying
2022-08-12 18:16:49 +08:00
parent 3a144db58f
commit fa65aae779
3 changed files with 6 additions and 3 deletions

View File

@@ -791,14 +791,15 @@ export class GuildHandler {
const roleId = session.get('roleId');
const roleName = session.get('roleName');
const serverId = session.get('serverId');
const { code, info } = msg;
const { code, info, myUserGuild } = msg;
const guild = await GuildModel.findByCode(code, serverId, 'members');
if (!guild) return resResult(STATUS.GUILD_NOT_FOUND);
const { members } = guild;
const jobName = myUserGuild.auth == 1? '大将军': '管理';
//下发邮件
await sendMailToGuildByContent(MAIL_TYPE.SEND_MAIL, code, { sendName: roleName, params: [info] }, guild);
await sendMailToGuildByContent(MAIL_TYPE.GUILD_MAIL, code, { sendName: `${jobName}${roleName}`, params: [info] }, guild);
return resResult(STATUS.SUCCESS, { isSuccess: true });
}

View File

@@ -120,7 +120,8 @@ class MailTemp {
this.endTime = this.sendTime + dicMail?.time||0;
this.content = this.getContent(dicMail.content, params.params);
if(dicMail.title) this.title = dicMail.title;
if(dicMail.sendName) this.sendName = dicMail.sendName;
if(dicMail.sendName || params.sendName) this.sendName = params.sendName||dicMail.sendName;
this.hasGoods = params.goods?.length > 0;
this.goods = params.goods||[];
}

View File

@@ -58,6 +58,7 @@ export enum MAIL_TYPE {
DAILY_COIN = 28, // 招财进宝宝箱
GUILD_DISSMISS = 29, // 军团解散
LADDER = 30, // 名将擂台
GUILD_MAIL = 31, // 军团邮件
};
export const SEND_NAME = '系统';