feat(后台): 批量邮件

This commit is contained in:
luying
2023-06-03 20:02:24 +08:00
parent 6e5a8affe9
commit ac877d9561
12 changed files with 435 additions and 308 deletions

View File

@@ -47,6 +47,16 @@ export default class MailController extends Controller {
public async updateGMMail() {
const { ctx } = this;
const msg = ctx.request.body;
if(msg.receivers && msg.receivers.length > 0) {
try {
for(let receiver of msg.receivers) {
if(receiver.rewards) receiver.rewards = JSON.parse(receiver.rewards);
}
} catch(e) {
return ctx.body = ctx.service.utils.resResult(STATUS.WRONG_PARMS);
}
}
let params = new UpdateMailParams(msg);
let check = params.checkParams();
if(!check) return ctx.body = ctx.service.utils.resResult(STATUS.WRONG_PARMS);