Commit 725252d4 by zhujian

'fixed'

parent 1eb07e26
......@@ -66,6 +66,8 @@
prod: 'https://gateway-heimdall.xiaomai5.com/'
};
function getParameterByName(name) {
name = name.replace(/[\\[]/, '\\[').replace(/[\]]/, '\\]')
const regex = new RegExp('[\\?&]' + name + '=([^&#]*)')
......@@ -81,6 +83,9 @@
const ticket = getParameterByName('ticket');
console.log(appTermEnum, code, ticket);
if (!code) {
const url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww409ccf9c6e31f19e&redirect_uri=${location.href}&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect`
location.href = url
return
}
const ajaxOptions = {
......
......@@ -26,11 +26,11 @@ export default function WechatLogin(props: any) {
Service.Hades("anon/hades/getTicket", {}).then((res: any) => {
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'}`
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`
console.log(url)
// 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`
// console.log(url)
let qrnode = new qrcode({
text: res.result,
text: redirect,
correctLevel: 2,
size: 160,
image: Logo,
......@@ -63,7 +63,7 @@ export default function WechatLogin(props: any) {
}
Service.Hades('anon/hades/getTicketState', {
ticket
})
})
}, [leftTime])
return <div className='wechatLoginBox'>
......
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