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
b16e7c8d
Commit
b16e7c8d
authored
Sep 06, 2021
by
尚顺利
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
钉钉扫码
parent
30861356
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
15 deletions
+16
-15
login.js
src/pages/user/login/login.js
+12
-12
infoLogin.js
src/pages/user/login/template/infoLogin.js
+4
-3
No files found.
src/pages/user/login/login.js
View file @
b16e7c8d
...
...
@@ -449,7 +449,7 @@ class Login {
const
handleMessage
=
function
(
event
)
{
const
{
origin
}
=
event
;
Logger
.
log
(
'origin'
,
event
.
origin
);
//
Logger.log('origin', event.origin);
if
(
origin
===
'https://login.dingtalk.com'
)
{
// 判断是否来自ddLogin扫码事件。
const
loginTmpCode
=
event
.
data
;
...
...
@@ -469,17 +469,17 @@ class Login {
ddLoginIn
(
code
)
{
// eslint-disable-next-line no-undef
const
self
=
this
;
appService
.
getOA
({
query
:
{
TmpAuthCode
:
code
,
},
TmpAuthCode
:
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
)
{
// 判断是否存在参数
...
...
@@ -487,13 +487,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
;
// 已经输错过密码
}
});
}
...
...
@@ -601,7 +601,7 @@ class Login {
getUserInfoAndConfig
(
failCallback
,
flag
,
industry
)
{
const
{
token
:
tk
}
=
this
.
globalConfig
;
const
token
=
tk
||
Cookies
.
get
(
'token'
)
const
token
=
tk
||
Cookies
.
get
(
'token'
)
;
const
site
=
Cookies
.
get
(
'site'
);
const
self
=
this
;
/* eslint-disable */
...
...
src/pages/user/login/template/infoLogin.js
View file @
b16e7c8d
...
...
@@ -2,7 +2,7 @@
/*
* @Author: shangshunli;
* @Date: 2021-08-02 09:39:46;
* @LastEditTime: 2021-09-0
3 15:37:12
* @LastEditTime: 2021-09-0
6 09:35:36
* @LastEditors: shangshunli
* @Description:信息化登录页;
*/
...
...
@@ -43,10 +43,10 @@ class InfoLogin extends React.Component{
loginStyle
:
!
this
.
state
.
loginStyle
,
ddOrWeixin
:
ddOrWeixin
?
''
:
'dingding'
},()
=>
{
Cookies
.
set
(
'loginMode'
,
`
${
ddOrWeixin
?
'pdw'
:
'dingding
'
}
`
,
{
Cookies
.
set
(
'loginMode'
,
`
${
this
.
state
.
ddOrWeixin
?
'dingding'
:
'pdw
'
}
`
,
{
path
:
'/'
,
});
if
(
ddOrWeixin
===
'dingding'
){
if
(
this
.
state
.
ddOrWeixin
===
'dingding'
){
let
action
=
new
LoginAction
(
this
.
props
,
false
,
true
)
action
.
loginByDD
()
}
...
...
@@ -100,6 +100,7 @@ changeQrCode=(item)=>{
this
.
loginEvent
(
action
)
}
// 登录成功事件
loginEvent
(
action
){
action
.
globalConfig
=
this
.
props
.
global
;
this
.
props
.
updateCurrentIndex
&&
this
.
props
.
updateCurrentIndex
(
-
1
);
...
...
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