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
2a993011
Commit
2a993011
authored
Jan 11, 2021
by
zhujian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
'fixed'
parent
ccf77bc2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
4 deletions
+43
-4
public/h5.html
+19
-1
src/modules/root/WechatLogin.tsx
+24
-3
No files found.
public/h5.html
View file @
2a993011
...
@@ -37,17 +37,27 @@
...
@@ -37,17 +37,27 @@
line-height
:
24px
;
line-height
:
24px
;
margin-top
:
12px
;
margin-top
:
12px
;
}
}
.hide
{
display
:
none
;
}
</style>
</style>
</head>
</head>
<body>
<body>
<div
class=
"box"
>
<div
class=
"box"
>
<div>
<div
id=
'success'
class=
'hide'
>
<img
src=
"https://image.xiaomaiketang.com/xm/iRkcMHPHba.png"
style=
'width:60px'
alt=
""
>
<img
src=
"https://image.xiaomaiketang.com/xm/iRkcMHPHba.png"
style=
'width:60px'
alt=
""
>
<p>
<p>
扫码成功
扫码成功
</p>
</p>
</div>
</div>
<div
id=
"error"
class=
'hide'
>
<img
src=
"https://image.xiaomaiketang.com/xm/iRkcMHPHba.png"
style=
'width:60px'
alt=
""
>
<p
id=
'message'
>
</p>
</div>
</div>
</div>
...
@@ -101,7 +111,15 @@
...
@@ -101,7 +111,15 @@
dataType
:
'json'
,
dataType
:
'json'
,
success
(
res
,
status
,
xhr
)
{
success
(
res
,
status
,
xhr
)
{
if
(
res
.
code
==
200
)
{
$
(
'#success'
).
show
()
}
else
{
$
(
'#error'
).
show
();
var
message
=
res
.
message
.
split
(
','
).
join
(
'<br />'
)
$
(
'#message'
).
html
(
message
)
}
},
},
};
};
...
...
src/modules/root/WechatLogin.tsx
View file @
2a993011
import
React
,
{
useState
,
useRef
,
useEffect
}
from
'react'
;
import
React
,
{
useState
,
useRef
,
useEffect
}
from
'react'
;
import
qrcode
from
'@/core/qrcode/qrcode.js'
import
qrcode
from
'@/core/qrcode/qrcode.js'
import
Service
from
"@/common/js/service"
;
import
Service
from
"@/common/js/service"
;
import
User
from
'@/common/js/user'
;
import
'./WechatLogin.less'
import
'./WechatLogin.less'
const
Logo
=
require
(
"@/common/images/logo.png"
)
const
Logo
=
require
(
"@/common/images/logo.png"
)
declare
var
location
:
any
;
declare
var
location
:
any
;
...
@@ -61,9 +62,29 @@ export default function WechatLogin(props: any) {
...
@@ -61,9 +62,29 @@ export default function WechatLogin(props: any) {
if
(
leftTime
==
60
||
!
ticket
)
{
if
(
leftTime
==
60
||
!
ticket
)
{
return
return
}
}
Service
.
Hades
(
'anon/hades/getTicketState'
,
{
useEffect
(()
=>
{
ticket
if
(
leftTime
==
60
||
!
ticket
)
{
})
return
}
Service
.
Hades
(
'anon/hades/getTicketState'
,
{
ticket
}).
then
((
res
:
any
)
=>
{
if
(
res
.
result
===
'AUTH_SUCCESS'
)
{
Service
.
Hades
(
'anon/hades/getTicketWXWorkLogin'
,
{
ticket
}).
then
((
_res
:
any
)
=>
{
User
.
setUserId
(
_res
.
result
.
loginInfo
.
userId
);
User
.
setToken
(
_res
.
result
.
loginInfo
.
xmToken
);
window
.
RCHistory
.
push
({
pathname
:
`/switch-route`
,
})
})
}
})
},
[
leftTime
])
},
[
leftTime
])
},
[
leftTime
])
return
<
div
className=
'wechatLoginBox'
>
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