Commit 39c6672e authored by Hsinli's avatar Hsinli

addd

parent 03f92ab8
Pipeline #19294 passed with stage
in 7 seconds
...@@ -78,7 +78,8 @@ class CheckService extends Service { ...@@ -78,7 +78,8 @@ class CheckService extends Service {
async check() { async check() {
const { ctx } = this; const { ctx } = this;
let ret = { let ret = {
is_target_user: 0//1 true 0 false -1 NOT_FOUND is_target_user: 0,//1 true 0 false -1 NOT_FOUND
url: ''
} }
if (!ctx.oldUserId || !ctx.userId) { if (!ctx.oldUserId || !ctx.userId) {
//如果没有登录就不做处理 //如果没有登录就不做处理
...@@ -132,10 +133,30 @@ class CheckService extends Service { ...@@ -132,10 +133,30 @@ class CheckService extends Service {
} else { } else {
ctx.failed('服务异常,请稍后再试'); ctx.failed('服务异常,请稍后再试');
} }
if (ret.is_target_user === 1) {
let businessIds = this.CFG_ENV === 'dev' ? 1 : (this.CFG_ENV === 'uat' ? 2 : 3);
let businessInfo = await this.getBusinessInfo();
ret.url = businessInfo.url;
}
return ret; return ret;
}
/**
* 获取业务信息,type=4表示普通贷款
* @param {integer|string} id 业务编号
* @returns {object} businessInfo 业务相关信息
*/
async getBusinessInfo(id) {
const { ctx } = this;
let url = this.config.CASSANDRA_API + '/huodong/bu_basic/' + id + '?type=4';
let result = await ctx.helper.send_request(url, {}, {
method: 'GET',
});
ctx.logger.info(url + ':' + JSON.stringify(result));
let businessInfo = (result.status === 200 && result.data && result.data.ret) ? result.data.ret : {};
return businessInfo;
} }
......
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