From 5b5281c8a4b3f2b7e0545859149e8a72ae6ae4fc Mon Sep 17 00:00:00 2001 From: mutoe Date: Thu, 31 Jan 2019 14:46:21 +0800 Subject: [PATCH] =?UTF-8?q?fix(SPA):=20=E4=BF=AE=E5=A4=8D=E5=9C=A8=20hash?= =?UTF-8?q?=20=E6=A8=A1=E5=BC=8F=E4=B8=8B=E6=97=A0=E6=B3=95=E5=BE=AE?= =?UTF-8?q?=E4=BF=A1=E7=99=BB=E5=BD=95=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/spa/src/page/wechat/WechatSignin.vue | 2 +- resources/spa/src/util/wechat.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/resources/spa/src/page/wechat/WechatSignin.vue b/resources/spa/src/page/wechat/WechatSignin.vue index b4ede9622..14ae7318f 100644 --- a/resources/spa/src/page/wechat/WechatSignin.vue +++ b/resources/spa/src/page/wechat/WechatSignin.vue @@ -79,7 +79,7 @@ export default { let accessToken = this.$lstore.getData('H5_WECHAT_MP_ASTOKEN') if (!accessToken || !openId) { - const { data } = await this.$http.get(`socialite/getAccess/${code}`, { validateStatus: s => s === 200 }) + const { data } = await this.$http.get(`/socialite/getAccess/${code}`, { validateStatus: s => s === 200 }) const { access_token: newAccessToken, openid: newOpenId } = data accessToken = newAccessToken openId = newOpenId diff --git a/resources/spa/src/util/wechat.js b/resources/spa/src/util/wechat.js index 01007f58a..3bdf254a7 100644 --- a/resources/spa/src/util/wechat.js +++ b/resources/spa/src/util/wechat.js @@ -1,7 +1,9 @@ import api from '@/api/api' export const signinByWechat = () => { - const redirectUrl = window.location.origin + process.env.BASE_URL + 'wechat/' + let redirectUrl = window.location.origin + process.env.BASE_URL + if (process.env.VUE_APP_ROUTER_MODE === 'hash') redirectUrl += '#/' + redirectUrl += 'wechat/' api .post( 'socialite/getOriginUrl',