Commit 43481f70 by zhujian

'fixed'

parent f7a1c2ba
...@@ -26,7 +26,7 @@ export default function WechatLogin(props: any) { ...@@ -26,7 +26,7 @@ export default function WechatLogin(props: any) {
if (status === 0) { if (status === 0) {
Service.Hades("anon/hades/getTicket", {}).then((res: any) => { Service.Hades("anon/hades/getTicket", {}).then((res: any) => {
setTicket(res.result) setTicket(res.result)
const redirect = `${location.origin + location.pathname.replace('index.html', 'h5.html')}?ticket=${res.result}&appTermEnum=XIAOMAI_CLOUD_CLASS_PC_WEB_ADMIN&env=${process.env.DEPLOY_ENV || 'dev'}` const redirect = `${location.origin + (location.pathname.endsWith('index.html') ? location.pathname.replace('index.html', 'h5.html') : (location.pathname + 'h5.html'))}?ticket=${res.result}&appTermEnum=XIAOMAI_CLOUD_CLASS_PC_WEB_ADMIN&env=${process.env.DEPLOY_ENV || 'dev'}`
// console.log(redirect) // console.log(redirect)
// const url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww409ccf9c6e31f19e&redirect_uri=${encodeURIComponent(redirect)}&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect` // const url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww409ccf9c6e31f19e&redirect_uri=${encodeURIComponent(redirect)}&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect`
// console.log(url) // console.log(url)
...@@ -73,7 +73,7 @@ export default function WechatLogin(props: any) { ...@@ -73,7 +73,7 @@ export default function WechatLogin(props: any) {
User.setToken(_res.result.loginInfo.xmToken); User.setToken(_res.result.loginInfo.xmToken);
window.RCHistory.push({ window.RCHistory.push({
pathname: `/switch-route`, pathname: `/switch-route`,
}) })
}) })
} }
......
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