Commit 561a3991 authored by 李尚科's avatar 李尚科

fix

parent 857af75e
Pipeline #16160 passed with stage
in 45 seconds
...@@ -43,16 +43,19 @@ class WechatController extends Controller { ...@@ -43,16 +43,19 @@ class WechatController extends Controller {
const bind_phone_result = await ctx.helper.send_request(user_exist_url, { type: 5 }, { method: 'GET' }); const bind_phone_result = await ctx.helper.send_request(user_exist_url, { type: 5 }, { method: 'GET' });
ctx.logger.info(JSON.stringify({ bind_phone_result: bind_phone_result })); ctx.logger.info(JSON.stringify({ bind_phone_result: bind_phone_result }));
if (bind_phone_result.status !== 200) { if (bind_phone_result.status !== 200) {
ctx.redirect(redirect_url + `?channel_id=${channel_id}&type=noLogin&openid=${openid}`); return; ctx.redirect(redirect_url + `?channel_id=${channel_id}&type=noLogin`); return;
} }
const user_exist_ret = bind_phone_result.data; const user_exist_ret = bind_phone_result.data;
if (user_exist_ret.result != 'true') {//未绑定的手机号时 if (user_exist_ret.result != 'true') {//未绑定的手机号时
ctx.redirect(redirect_url + `?channel_id=${channel_id}&type=noLogin&openid=${openid}`); return; ctx.redirect(redirect_url + `?channel_id=${channel_id}&type=noLogin`); return;
} }
const user_id = user_exist_ret.uid; const user_id = user_exist_ret.uid;
//已绑定手机的 继续 判断是否有导入公积金 //已绑定手机的 继续 判断是否有导入公积金
await this.user_login({ code, openid, channel_id });//已绑定的用户 直接登录 const login_result = await this.user_login({ code, openid, channel_id });//已绑定的用户 直接登录
if (login_result.anew && !login_result.token) {
ctx.redirect(redirect_url + `?channel_id=${channel_id}&type=noLogin`); return;
}
const gjj_exist_url = `${this.app.config.NODE_BASE_URL}/cassandra-server/gjj/list/${user_id}`; const gjj_exist_url = `${this.app.config.NODE_BASE_URL}/cassandra-server/gjj/list/${user_id}`;
const gjj_exist_result = await ctx.helper.send_request(gjj_exist_url, {}, { method: 'GET' }); const gjj_exist_result = await ctx.helper.send_request(gjj_exist_url, {}, { method: 'GET' });
...@@ -155,6 +158,9 @@ class WechatController extends Controller { ...@@ -155,6 +158,9 @@ class WechatController extends Controller {
} }
if (!user_login_data.token || !user_login_data.uid) { if (!user_login_data.token || !user_login_data.uid) {
const error_msg = user_login_data.error ? user_login_data.error : '用户的登录失败'; const error_msg = user_login_data.error ? user_login_data.error : '用户的登录失败';
if (error_msg === '需要重新授权') {
return { anew: 1 };
}
ctx.failed(error_msg); ctx.failed(error_msg);
} }
//获取用户信息 //获取用户信息
......
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