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