过滤无用消息
This commit is contained in:
@@ -309,30 +309,31 @@ class HomeController extends Controller {
|
||||
|
||||
// 保存未知消息
|
||||
async saveUnknown() {
|
||||
const { ctx } = this;
|
||||
const ctx = this.ctx;
|
||||
try {
|
||||
const body = ctx.request.body;
|
||||
const { system_type, original_msg, msg_data, created_at } = body;
|
||||
const { msg_id, sn_number, original_msg, msg_data, created_at } = body;
|
||||
const form = {
|
||||
system_type: system_type,
|
||||
msg_id: msg_id,
|
||||
sn_number: sn_number,
|
||||
original_msg: original_msg,
|
||||
msg_data: msg_data,
|
||||
created_at: created_at
|
||||
};
|
||||
const result = await ctx.service.home.saveUnknown(form);
|
||||
if (result == "error") {
|
||||
this.setResponse(ctx, 500, '服务器错误', "none");
|
||||
setResponse(ctx, 500, '服务器错误', "none");
|
||||
return;
|
||||
}
|
||||
if (result) {
|
||||
this.setResponse(ctx, 200, '保存未知消息成功', "none");
|
||||
setResponse(ctx, 200, '保存未知消息成功', "none");
|
||||
} else {
|
||||
this.setResponse(ctx, 404, '保存未知消息失败', "none");
|
||||
setResponse(ctx, 404, '保存未知消息失败', "none");
|
||||
}
|
||||
} catch (error) {
|
||||
const blockName = fileName + "--" + "saveUnknown";
|
||||
ctx.app.middleware.log('../../controllerLog', blockName + ">>>>" + error);
|
||||
this.setResponse(ctx, 500, '服务器错误', "none");
|
||||
ctx.app.middleware.utils.log('../../controllerLog', blockName + ">>>>" + error);
|
||||
setResponse(ctx, 500, '服务器错误', "none");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user