Commit ce611868 authored by 李尚科's avatar 李尚科

fix

parent d5cac657
Pipeline #15670 passed with stage
in 6 seconds
...@@ -20,7 +20,7 @@ class WechatController extends Controller { ...@@ -20,7 +20,7 @@ class WechatController extends Controller {
const appsecret = ['https://lan-nginx.jianbing.com', 'https://pro-nginx.jianbing.com'].includes(this.config.NODE_BASE_URL) ? WECHAT_SECRET : WECHAT_SECRET_TEST; const appsecret = ['https://lan-nginx.jianbing.com', 'https://pro-nginx.jianbing.com'].includes(this.config.NODE_BASE_URL) ? WECHAT_SECRET : WECHAT_SECRET_TEST;
if (!code || code.length === 0) { if (!code || code.length === 0) {
const target_url = WECHAT_CODE_URL + `?appid=${app_id}&redirect_uri=${encodeURIComponent(`${this.app.config.OUT_P_NODE_URL}/51business/api/gjj/wechat/oauth_login?&channel_id=${channel_id}`)}&response_type=code&scope=snsapi_base&state=gjjquery#wechat_redirect`; const target_url = WECHAT_CODE_URL + `?appid=${app_id}&redirect_uri=${encodeURIComponent(`${this.app.config.OUT_P_NODE_URL}/51business/api/gjj/wechat/oauth_login?&channel_id=${channel_id}`)}&response_type=code&scope=snsapi_base&state=gjjquery#wechat_redirect`;
ctx.redirect(target_url); ctx.redirect(target_url); return;
} }
const url = `${WECHAT_AUTH}?appid=${app_id}&secret=${appsecret}&code=${code}&grant_type=authorization_code` const url = `${WECHAT_AUTH}?appid=${app_id}&secret=${appsecret}&code=${code}&grant_type=authorization_code`
const result = await ctx.helper.send_request(url, {}, { method: 'GET' }); const result = await ctx.helper.send_request(url, {}, { method: 'GET' });
......
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