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
62b27aa3
Commit
62b27aa3
authored
Jan 11, 2021
by
zhujian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
'fixed'
parent
ae719532
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
2 deletions
+32
-2
public/h5.html
+27
-0
src/modules/root/WechatLogin.tsx
+5
-2
No files found.
public/h5.html
View file @
62b27aa3
...
...
@@ -20,10 +20,37 @@
<title>
小麦企培
</title>
<script
type=
"text/javascript"
charset=
"utf-8"
src=
"./jquery.min.js"
></script>
<style
type=
"text/css"
>
.box
{
width
:
100%
;
height
:
100vh
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
}
p
{
font-size
:
17px
;
font-family
:
PingFangSC-Regular
,
PingFang
SC
;
font-weight
:
400
;
color
:
#333333
;
line-height
:
24px
;
margin-top
:
12px
;
}
</style>
</head>
<body>
<div
class=
"box"
>
<div>
<img
src=
"https://image.xiaomaiketang.com/xm/iRkcMHPHba.png"
style=
'width:60px'
alt=
""
>
<p>
扫码成功
</p>
</div>
</div>
</body>
...
...
src/modules/root/WechatLogin.tsx
View file @
62b27aa3
...
...
@@ -3,6 +3,7 @@ import qrcode from '@/core/qrcode/qrcode.js'
import
Service
from
"@/common/js/service"
;
import
'./WechatLogin.less'
const
Logo
=
require
(
"@/common/images/logo.png"
)
declare
var
location
:
any
;
export
default
function
WechatLogin
(
props
:
any
)
{
const
freshTime
=
60
;
...
...
@@ -23,7 +24,10 @@ export default function WechatLogin(props: any) {
clearInterval
(
timer
.
current
as
any
);
if
(
status
===
0
)
{
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
)
let
qrnode
=
new
qrcode
({
text
:
res
.
result
,
correctLevel
:
2
,
...
...
@@ -56,7 +60,6 @@ export default function WechatLogin(props: any) {
if
(
leftTime
==
60
)
{
return
}
return
Service
.
Hades
(
'anon/hades/wXWorkUserLogin'
,
{
appTermEnum
:
'XIAOMAI_CLOUD_CLASS_PC_WEB_ADMIN'
,
code
:
ticket
...
...
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