Commit c2da6f97 authored by Hsinli's avatar Hsinli

addd

parent e19806fd
Pipeline #19318 passed with stage
in 56 seconds
...@@ -17,7 +17,9 @@ class CheckController extends Controller { ...@@ -17,7 +17,9 @@ class CheckController extends Controller {
*/ */
async getCheck() { async getCheck() {
const { ctx } = this; const { ctx } = this;
const ret = await ctx.service.duxiaoman.check.check(); let params = ctx.request.query;
let businessId = params['business_id'] || 142;
const ret = await ctx.service.duxiaoman.check.check(businessId);
ctx.success(ret); ctx.success(ret);
} }
......
...@@ -75,7 +75,7 @@ class CheckService extends Service { ...@@ -75,7 +75,7 @@ class CheckService extends Service {
return sign; return sign;
} }
async check() { async check(bid) {
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
...@@ -110,7 +110,6 @@ class CheckService extends Service { ...@@ -110,7 +110,6 @@ class CheckService extends Service {
dxmUrl += i + '=' + params[i] + '&'; dxmUrl += i + '=' + params[i] + '&';
} }
dxmUrl = dxmUrl.substring(0, dxmUrl.length - 1); dxmUrl = dxmUrl.substring(0, dxmUrl.length - 1);
ctx.logger.info('dxmUrl:' + dxmUrl);
let result = await ctx.helper.send_request(dxmUrl, {}, { method: 'GET' }); let result = await ctx.helper.send_request(dxmUrl, {}, { method: 'GET' });
ctx.logger.info('result:' + JSON.stringify(result)); ctx.logger.info('result:' + JSON.stringify(result));
if (result.status === 200) { if (result.status === 200) {
...@@ -134,7 +133,9 @@ class CheckService extends Service { ...@@ -134,7 +133,9 @@ class CheckService extends Service {
ctx.failed('服务异常,请稍后再试'); ctx.failed('服务异常,请稍后再试');
} }
if (ret.is_target_user === 1) { if (ret.is_target_user === 1) {
let businessId = this.config.CFG_ENV === 'dev' ? 1 : (this.config.CFG_ENV === 'uat' ? 175 : 3); //pro环境 142对应193 143对应194
//uat环境 174对应175 176对应177
let businessId = this.config.CFG_ENV === 'pro' ? (bid === 142 ? 193 : 194) : (this.config.CFG_ENV === 'uat' ? (bid === 174 ? 175 : 177) : 1);
let businessInfo = await this.getBusinessInfo(businessId); let businessInfo = await this.getBusinessInfo(businessId);
ret.url = businessInfo.url; ret.url = businessInfo.url;
} }
......
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