Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xiaomai-cloud-class-web
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xiaomai-cloud-class
xiaomai-cloud-class-web
Commits
725252d4
Commit
725252d4
authored
Jan 11, 2021
by
zhujian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
'fixed'
parent
1eb07e26
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
+10
-5
public/h5.html
+5
-0
src/modules/root/WechatLogin.tsx
+5
-5
No files found.
public/h5.html
View file @
725252d4
...
...
@@ -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
=
{
...
...
src/modules/root/WechatLogin.tsx
View file @
725252d4
...
...
@@ -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
:
re
s
.
resul
t
,
text
:
re
direc
t
,
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'
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment