Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivWeb
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
CivWeb
Commits
9ad4dfd5
Commit
9ad4dfd5
authored
Sep 03, 2021
by
尚顺利
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
企业微信扫码
parent
204c5515
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
20 deletions
+23
-20
login.js
src/pages/user/login/login.js
+11
-12
infoLogin.js
src/pages/user/login/template/infoLogin.js
+12
-8
No files found.
src/pages/user/login/login.js
View file @
9ad4dfd5
...
...
@@ -41,13 +41,12 @@ class Login {
const
{
password
}
=
this
.
globalConfig
;
const
loginMode
=
Cookies
.
get
(
'loginMode'
)
||
null
;
if
(
loginMode
&&
loginMode
===
'iotWechat'
)
ddCode
=
null
;
const
self
=
this
;
// self.qrcodeLogin(self.globalConfig.qrcodeData.code);
if
(
token
)
{
self
.
getToweb
(
token
);
// eslint-disable-next-line no-empty
}
else
if
(
ddCode
&&
loginMode
!==
'qywx
'
)
{
}
else
if
(
ddCode
&&
loginMode
===
'dingding
'
)
{
self
.
ddLoginIn
(
ddCode
);
}
else
if
(
ddCode
&&
loginMode
===
'qywx'
)
{
self
.
qywxLoginIn
(
ddCode
);
...
...
@@ -392,8 +391,8 @@ class Login {
}
return
s
;
}
// 企业微信登录
// 企业微信登录
loginByWx
()
{
window
.
WwLogin
({
id
:
'wxlogin_container'
,
...
...
@@ -406,17 +405,17 @@ class Login {
qywxLoginIn
(
code
)
{
// eslint-disable-next-line no-undef
const
self
=
this
;
appService
.
getInfo
({
query
:
{
code
,
},
cacheBust
:
true
,
})
.
then
(
response
=>
{
if
(
response
&&
response
.
data
&&
response
.
data
.
getMe
)
{
const
tk
=
response
.
data
.
getMe
[
0
].
Token
;
this
.
globalConfig
.
token
=
tk
;
if
(
response
&&
response
.
getMe
&&
response
.
getMe
.
length
)
{
const
tk
=
response
.
getMe
[
0
].
Token
;
self
.
globalConfig
.
token
=
tk
;
Cookies
.
set
(
'token'
,
tk
);
let
url
=
window
.
location
.
href
;
// 获取当前页面的url
if
(
url
.
indexOf
(
'&code'
)
!==
-
1
)
{
// 判断是否存在参数
...
...
@@ -424,13 +423,13 @@ class Login {
url
=
url
.
replace
(
/
(\&
code|#
)[^
'"
]
*/
,
''
);
// 去除参数
window
.
history
.
pushState
({},
0
,
url
);
}
this
.
isSignIn
=
true
;
this
.
getUserInfoAndConfig
();
self
.
isSignIn
=
true
;
self
.
getUserInfoAndConfig
();
}
else
{
this
.
handleLoginError
();
self
.
handleLoginError
();
// msgUtils.fault("登录失败,请检查用户名或密码");
// msgUtils.fault("登录失败," + error.message);
this
.
hasTry
=
true
;
// 已经输错过密码
self
.
hasTry
=
true
;
// 已经输错过密码
}
});
}
...
...
src/pages/user/login/template/infoLogin.js
View file @
9ad4dfd5
...
...
@@ -2,7 +2,7 @@
/*
* @Author: shangshunli;
* @Date: 2021-08-02 09:39:46;
* @LastEditTime: 2021-0
8-23 11:07:30
* @LastEditTime: 2021-0
9-03 14:58:29
* @LastEditors: shangshunli
* @Description:信息化登录页;
*/
...
...
@@ -32,18 +32,23 @@ class InfoLogin extends React.Component{
isRember
:
false
,
//记住密码
ddOrWeixin
:
''
}
componentDidMount
(){
let
action
=
new
LoginAction
(
this
.
props
,
false
,
true
)
}
// 切换登录方式
changeloginStyle
=
()
=>
{
const
{
ddOrWeixin
}
=
this
.
state
this
.
setState
({
loginStyle
:
!
this
.
state
.
loginStyle
,
ddOrWeixin
:
ddOrWeixin
==
'dingding'
?
''
:
'dingding'
ddOrWeixin
:
ddOrWeixin
?
''
:
'dingding'
},()
=>
{
Cookies
.
set
(
'loginMode'
,
'dingding'
,
{
Cookies
.
set
(
'loginMode'
,
`
${
ddOrWeixin
?
'pdw'
:
'dingding'
}
`
,
{
path
:
'/'
,
});
if
(
ddOrWeixin
===
'dingding'
){
let
action
=
new
LoginAction
(
this
.
props
,
false
,
true
)
action
.
loginByDD
()
}
})
}
// 切换二维码
...
...
@@ -55,15 +60,14 @@ changeQrCode=(item)=>{
path
:
'/'
,
});
let
action
=
new
LoginAction
(
this
.
props
,
false
,
true
)
if
(
item
==
'dingding'
){
action
.
loginByDD
()
}
else
if
(
item
==
'qywx'
){
if
(
item
===
'qywx'
){
action
.
loginByWx
()
}
else
if
(
item
===
'dingding'
){
action
.
loginByDD
()
}
})
}
// 查看密码
seePassWord
=
(
e
)
=>
{
this
.
setState
({
...
...
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