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
e62762fc
Commit
e62762fc
authored
Jun 25, 2023
by
杨思琦
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 免密登录修改
parent
292a96ce
Pipeline
#74809
passed with stages
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
8 deletions
+9
-8
login.js
src/pages/user/login/login.js
+6
-5
noSecret.js
src/pages/user/login/noSecret.js
+3
-3
No files found.
src/pages/user/login/login.js
View file @
e62762fc
...
...
@@ -133,16 +133,17 @@ class Login {
getIpone
()
{
const
self
=
this
;
return
appService
.
getUserMobile
({
// isTest: true,
// isTest: true,
});
}
init
()
{
init
(
site
)
{
const
self
=
this
;
this
.
loginFailed
=
false
;
this
.
guid
=
Math
.
round
(
Math
.
random
()
*
10000
+
Date
.
now
()).
toString
(
16
);
this
.
redirect_state
=
Cookies
.
get
(
'redirect_state'
);
const
token
=
this
.
globalConfig
.
initToken
||
Cookies
.
get
(
'token'
)
||
params
.
getParams
(
'token'
);
const
noTokenSite
=
site
??
null
;
let
{
ddCode
}
=
this
.
globalConfig
;
let
{
loginName
}
=
this
.
globalConfig
;
let
{
password
}
=
this
.
globalConfig
;
...
...
@@ -170,7 +171,7 @@ class Login {
if
(
loginMode
&&
loginMode
===
'iotWechat'
)
ddCode
=
null
;
// self.qrcodeLogin(self.globalConfig.qrcodeData.code);
if
(
token
)
{
self
.
getToweb
(
token
);
self
.
getToweb
(
token
,
noTokenSite
);
// eslint-disable-next-line no-empty
}
else
if
(
ddCode
&&
loginMode
===
'dingding'
)
{
self
.
ddLoginIn
(
ddCode
);
...
...
@@ -192,14 +193,14 @@ class Login {
}
}
getToweb
(
token
)
{
getToweb
(
token
,
noTokenSite
)
{
this
.
globalConfig
.
token
=
token
;
const
self
=
this
;
// eslint-disable-next-line no-undef
getUserInfo
({
token
:
this
.
globalConfig
.
token
,
subOID
:
'subOID'
,
site
:
this
.
getLocalSiteBytoken
(
token
),
site
:
noTokenSite
??
this
.
getLocalSiteBytoken
(
token
),
'request.preventCache'
:
Date
.
now
(),
ignoreSite
:
true
,
})
...
...
src/pages/user/login/noSecret.js
View file @
e62762fc
...
...
@@ -23,8 +23,8 @@ const Login = forwardRef((props, _ref) => {
const
param
=
params
.
getParams
(
'token'
)?.
replaceAll
(
';'
,
'&'
);
return
param
?
decodeURIComponent
(
escape
(
param
))
:
null
;
});
const
[
authCod
e
]
=
useState
(()
=>
{
const
param
=
params
.
getParams
(
'
authCod
e'
)?.
replaceAll
(
';'
,
'&'
);
const
[
sit
e
]
=
useState
(()
=>
{
const
param
=
params
.
getParams
(
'
sit
e'
)?.
replaceAll
(
';'
,
'&'
);
return
param
?
decodeURIComponent
(
escape
(
param
))
:
null
;
});
// 需要在 GetGateWay 和 GetConfig 之后再执行登录。避免信息错落乱
...
...
@@ -70,7 +70,7 @@ const Login = forwardRef((props, _ref) => {
action
.
transformLoginHander
(
res
,
false
);
});
}
else
{
action
.
init
();
action
.
init
(
site
);
}
}
},
[
action
,
action
.
globalConfig
,
props
.
global
]);
...
...
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