北斗启航科技教育平台登录系统

This commit is contained in:
2026-03-27 17:50:18 +08:00
commit bdc25653a4
215 changed files with 5299 additions and 0 deletions

View File

@@ -0,0 +1,47 @@
'use strict';
const Controller = require('../core/base_controller');
const fileName = "Id2MVService";
class Id2MVServiceController extends Controller {
// 身份二要素核验
async checkIdCard() {
const { ctx } = this;
try {
// this.decryptRequest(body.idCard)
// this.decryptRequest(body.name)
const { idCard, name } = ctx.request.body;
const result = await ctx.service.id2MVService.checkIdCard(idCard, name);
if (result == "error") {
this.setResponse(ctx, 500, '服务器错误', "none");
return;
}
if (result.status == "1" || result.status == "2" || result.status == "3") {
this.setResponse(ctx, 200, result.msg, "none");
} else if (result.status == "600") {
setTimeout(async () => {
await ctx.curl('http://127.0.0.1:' + ctx.app.server.address().port + '/checkIdCard', {
dataType: 'json',
contentType: 'application/x-www-form-urlencoded',
method: 'POST',
timeout: 3000,
data: {
idCard,
name
},
});
}, 3000);
this.setResponse(ctx, 200, '正在核验中', "none");
} else {
this.setResponse(ctx, 404, '核验失败', "none");
}
} catch (error) {
const blockName = fileName + "--" + "checkIdCard";
ctx.app.middleware.log('../../controllerLog', blockName + ">>>>" + error);
this.setResponse(ctx, 500, '服务器错误', "none");
}
}
}
module.exports = Id2MVServiceController;