Commit 8f8aaa8a by zhaoxiqing

gsb

parent baade4f2
const system=require("../../system");
const Dao=require("../dao.base");
class IdauthlogDao extends Dao{
constructor(){
super(Dao.getModelName(IdauthlogDao));
}
}
module.exports=IdauthlogDao;
const system = require("../../system");
const settings = require("../../../config/settings");
const uiconfig = system.getUiConfig2(settings.wxconfig.appId);
module.exports = (db, DataTypes) => {
return db.define("idauthlog", {
userName: DataTypes.STRING(100),
userIdNo: DataTypes.STRING(100),
userBankNo: DataTypes.STRING(100),
userMobile: DataTypes.STRING(30),
result: {
type: DataTypes.BOOLEAN,
defaultValue: false
},
}, {
paranoid: true, //假的删除
underscored: true,
version: true,
freezeTableName: true,
//freezeTableName: true,
// define the table's name
tableName: 'c_idauth_log',
validate: {},
indexes: [
// Create a unique index on email
// {
// unique: true,
// fields: ['email']
// },
//
// // Creates a gin index on data with the jsonb_path_ops operator
// {
// fields: ['data'],
// using: 'gin',
// operator: 'jsonb_path_ops'
// },
//
// // By default index name will be [table]_[fields]
// // Creates a multi column partial index
// {
// name: 'public_by_author',
// fields: ['author', 'status'],
// where: {
// status: 'public'
// }
// },
//
// // A BTREE index with a ordered field
// {
// name: 'title_index',
// method: 'BTREE',
// fields: ['author', {attribute: 'title', collate: 'en_US', order: 'DESC', length: 5}]
// }
]
});
}
......@@ -36,6 +36,8 @@ class EcontractService extends ServiceBase {
this.utillbwSve = system.getObject("service.utillbwSve");
this.idauthlogDao = system.getObject("db.idauthlogDao")
this.ydCompanyIds = [
10173,
10174,
......@@ -1518,7 +1520,7 @@ class EcontractService extends ServiceBase {
});
}
let banklog = await this.bankthreelogDao.findOne({
let banklog = await this.idauthlogDao.findOne({
userName: params.idName,
userIdNo: params.idNo,
userBankNo: params.bankno,
......@@ -1531,6 +1533,12 @@ class EcontractService extends ServiceBase {
cardno: params.bankno
};
var threeResult = await this.utillbwSve.bankthree(bankthreeParams, "bankinfoAuth");
this.idauthlogDao.create({
userName: params.idName,
userIdNo: params.idNo,
userBankNo: params.bankno,
result: threeResult.code
});
// {"code":-110,"message":"手机号格式错误","data":{}}
//1成功,-110提示验证信息有误,-120亲,提供的信息不正确,请验证后再试!
console.log("threeResult-----------------------------", threeResult);
......@@ -1909,7 +1917,7 @@ class EcontractService extends ServiceBase {
});
}
let banklog = await this.bankthreelogDao.findOne({
let banklog = await this.idauthlogDao.findOne({
userName: params.idName,
userIdNo: params.idNo,
userBankNo: params.bankno,
......@@ -1925,6 +1933,13 @@ class EcontractService extends ServiceBase {
};
var threeResult = await this.utillbwSve.bankfour(bankthreeParams, "bankinfoAuth");
this.idauthlogDao.create({
userName: params.idName,
userIdNo: params.idNo,
userBankNo: params.bankno,
userMobile: params.mobile,
result: threeResult.code
});
// {"code":-110,"message":"手机号格式错误","data":{}}
//1成功,-110提示验证信息有误,-120亲,提供的信息不正确,请验证后再试!
console.log("threeResult-----------------------------", threeResult);
......
const system=require("../../system");
const ServiceBase=require("../sve.base");
class IdauthlogService extends ServiceBase{
constructor(){
super(ServiceBase.getDaoName(IdauthlogService));
}
}
module.exports=IdauthlogService;
......@@ -64,15 +64,15 @@ class UitlLBWService {
}],
headers: {"Content-Type": "application/x-www-form-urlencoded"},
});
console.log("请求===", rs.config);
console.log("请求===", rs.data);
console.log("返回状态===", rs.status);
console.log("返回参数===", rs.data);
if (rs.status === 200 && rs.data) {
if (rs.data.respCode != '00000000') { //验证通过
result.code = -120;
}
return result;
}
result.code = -120;
result.code = -110;
return result;
}
......@@ -125,15 +125,15 @@ class UitlLBWService {
}],
headers: {"Content-Type": "application/x-www-form-urlencoded"},
});
console.log("请求===", rs.config);
console.log("请求===", rs.data);
console.log("返回状态===", rs.status);
console.log("返回参数===", rs.data);
if (rs.status === 200 && rs.data) {
if (rs.data.respCode != '00000000') { //验证通过
result.code = -120;
}
return result;
}
result.code = -120;
result.code = -110;
return result;
}
......@@ -185,15 +185,15 @@ class UitlLBWService {
}],
headers: {"Content-Type": "application/x-www-form-urlencoded"},
});
console.log("请求===", rs.config);
console.log("请求===", rs.data);
console.log("返回状态===", rs.status);
console.log("返回参数===", rs.data);
if (rs.status === 200 && rs.data) {
if (rs.data.respCode != '00000000') { //验证通过
result.code = -120;
}
return result;
}
result.code = -120;
result.code = -110;
return result;
}
......
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