Commit 2eda1e65 authored by Hsinli's avatar Hsinli

addd

parent 63d43c0f
Pipeline #13662 passed with stage
in 25 seconds
......@@ -4,6 +4,10 @@
const Service = require('egg').Service;
const moment = require('moment');
const _ = require('lodash');
const TypeConfig = {
blacklist: 1,
callrisk: 2
}
class CommonService extends Service {
......@@ -251,7 +255,7 @@ class CommonService extends Service {
*/
async queryShuhemofang(type, data) {
const { ctx } = this;
if (['blacklist', 'callrisk'].includes(type)) {
if (!TypeConfig.hasOwnProperty(type)) {
ctx.failed('未知类型的数据检测');
}
let need = ['name', 'id_card', 'phone'];
......@@ -262,7 +266,7 @@ class CommonService extends Service {
}
let ret = await this.requestShuhemofang(data);
let shuhemofangData = {
type: type === 'blacklist' ? 1 : 2,
type: TypeConfig[type],
user_id: ctx.userId,
app_user_id: ctx.appUserId,
app_id: ctx.appId,
......@@ -324,7 +328,7 @@ class CommonService extends Service {
*/
async shuhemofangCheck(type, inputParams) {
const { ctx } = this;
if (['blacklist', 'callrisk'].includes(type)) {
if (!TypeConfig.hasOwnProperty(type)) {
ctx.failed('未知类型的数据检测');
}
//1:判断用户当前三要素是否已经校验过
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment