捐献所

This commit is contained in:
mamengke01
2021-02-03 10:38:58 +08:00
parent 1fb4e7b9be
commit f836d6586a
9 changed files with 38 additions and 183 deletions

View File

@@ -25,15 +25,15 @@ export function getContent(operate: number, params: string[]) {
}
return content
}
export async function getMailContent(roleId: string, operate: number, params: string[], goods:RewardInter[], mails:MailType[], pushMessage:pushMail[], sendName: string = '系统') {
export async function getMailContent(roleId: string, operate: number, params: string[], goods: RewardInter[], mails: MailType[], pushMessage: pushMail[], sendName: string = '系统') {
const doc = new MailModel();
let content = getContent( operate, params);
const mail = Object.assign(doc.toJSON(), {roleId, goods, sendName, mailId: 1, sendTime: nowSeconds(), content});
const mail = Object.assign(doc.toJSON(), { roleId, goods, sendName, mailId: 1, sendTime: nowSeconds(), content });
mails.push(mail);
let key = 'login_roleId_' + roleId;
let sid = await getRedis(key);
if (!!sid) {
pushMessage.push({route: 'onMailsAdd', data:[mail], uids: [{uid:roleId, sid}]});
pushMessage.push({route: 'onMailsAdd', data:[mail], uids: [{ uid: roleId, sid }]});
}
}