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
2f0d9525
Commit
2f0d9525
authored
Apr 27, 2021
by
wufan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'hotfix/zhangleyuan/20210426/qrcode' into 'master'
Hotfix/zhangleyuan/20210426/qrcode See merge request
!16
parents
2f055add
3bad30ec
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
10 deletions
+11
-10
src/common/js/axios.ts
+1
-2
src/modules/root/Login.jsx
+1
-1
src/modules/root/WechatLogin.tsx
+9
-7
No files found.
src/common/js/axios.ts
View file @
2f0d9525
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: 吴文洁
* @Author: 吴文洁
* @Date: 2020-08-31 09:34:31
* @Date: 2020-08-31 09:34:31
* @LastEditors: zhangleyuan
* @LastEditors: zhangleyuan
* @LastEditTime: 2021-0
1-09 14:39:46
* @LastEditTime: 2021-0
4-27 16:59:07
* @Description:
* @Description:
* @Copyright: 杭州杰竞科技有限公司 版权所有
* @Copyright: 杭州杰竞科技有限公司 版权所有
*/
*/
...
@@ -96,7 +96,6 @@ class Axios {
...
@@ -96,7 +96,6 @@ class Axios {
case
401
:
case
401
:
User
.
removeUserId
();
User
.
removeUserId
();
User
.
removeToken
();
User
.
removeToken
();
message
.
error
(
'请登录'
);
window
.
RCHistory
.
replace
(
'/login'
);
window
.
RCHistory
.
replace
(
'/login'
);
break
;
break
;
case
403
:
case
403
:
...
...
src/modules/root/Login.jsx
View file @
2f0d9525
...
@@ -34,7 +34,7 @@ function Login(props) {
...
@@ -34,7 +34,7 @@ function Login(props) {
User
.
setCustomerStoreId
(
storeId
);
User
.
setCustomerStoreId
(
storeId
);
}
}
if
(
from
===
'customer'
&&
enterpriseId
&&
userId
)
{
if
(
from
===
'customer'
&&
enterpriseId
&&
userId
)
{
if
(
!
user
.
getToken
()
||
enterpriseId
!==
user
.
getEnterpriseId
())
{
if
(
!
user
.
getToken
()
||
enterpriseId
!==
user
.
getEnterpriseId
()
||
userId
!==
User
.
getUserId
()
)
{
getWXWorkLoginNoCheck
(
enterpriseId
,
userId
);
getWXWorkLoginNoCheck
(
enterpriseId
,
userId
);
}
else
{
}
else
{
window
.
RCHistory
.
push
({
window
.
RCHistory
.
push
({
...
...
src/modules/root/WechatLogin.tsx
View file @
2f0d9525
import
React
,
{
useState
,
useRef
,
useEffect
}
from
'react'
;
import
React
,
{
useState
,
useRef
,
useEffect
}
from
'react'
;
import
qrcode
from
'@/core/qrcode/qrcode.js'
import
qrcode
from
"@/libs/qrcode/qrcode.js"
;
import
Service
from
"@/common/js/service"
;
import
Service
from
"@/common/js/service"
;
import
User
from
'@/common/js/user'
;
import
User
from
'@/common/js/user'
;
import
{
PATH
}
from
'@/domains/basic-domain/constants'
;
import
{
PATH
}
from
'@/domains/basic-domain/constants'
;
...
@@ -7,6 +7,7 @@ import './WechatLogin.less'
...
@@ -7,6 +7,7 @@ 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
;
export
default
function
WechatLogin
(
props
:
any
)
{
export
default
function
WechatLogin
(
props
:
any
)
{
const
freshTime
=
60
;
const
freshTime
=
60
;
const
init
:
any
=
null
;
const
init
:
any
=
null
;
...
@@ -31,15 +32,18 @@ export default function WechatLogin(props: any) {
...
@@ -31,15 +32,18 @@ export default function WechatLogin(props: any) {
// 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)
const
qrcodeWrapDom
:
any
=
document
.
querySelector
(
'#qrcode'
);
let
qrnode
=
new
qrcode
({
let
qrnode
=
new
qrcode
({
text
:
redirect
,
text
:
redirect
,
correctLevel
:
2
,
correctLevel
:
2
,
size
:
160
,
size
:
160
,
image
:
Logo
,
image
:
Logo
,
imageSize
:
50
imageSize
:
50
});
});
QRCode
.
current
.
innerHTML
=
''
qrcodeWrapDom
.
innerHTML
=
''
;
QRCode
.
current
.
prepend
(
qrnode
);
qrcodeWrapDom
&&
qrcodeWrapDom
.
appendChild
(
qrnode
);
// QRCode.current.innerHTML = ''
// QRCode.current.prepend(qrnode);
setLeftTime
(
freshTime
);
setLeftTime
(
freshTime
);
timer
.
current
=
setInterval
(()
=>
{
timer
.
current
=
setInterval
(()
=>
{
if
(
leftTimeRef
.
current
==
0
)
{
if
(
leftTimeRef
.
current
==
0
)
{
...
@@ -85,9 +89,7 @@ export default function WechatLogin(props: any) {
...
@@ -85,9 +89,7 @@ export default function WechatLogin(props: any) {
return
<
div
className=
'wechatLoginBox'
>
return
<
div
className=
'wechatLoginBox'
>
<
div
className=
"rwm"
>
<
div
className=
"rwm"
>
<
div
id=
"qrcode"
ref=
{
(
dom
)
=>
{
<
div
id=
"qrcode"
></
div
>
QRCode
.
current
=
dom
}
}
></
div
>
{
{
status
===
1
&&
<
div
className=
"error"
>
status
===
1
&&
<
div
className=
"error"
>
...
...
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