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
ee2d6795
Commit
ee2d6795
authored
Jul 17, 2024
by
李纪文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: noSecret增加和达免登
parent
eb43fc49
Pipeline
#90924
passed with stages
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
3 deletions
+22
-3
base.js
src/api/service/base.js
+6
-0
noSecret.js
src/pages/user/login/noSecret.js
+9
-2
render.js
src/render.js
+7
-1
No files found.
src/api/service/base.js
View file @
ee2d6795
...
...
@@ -22,6 +22,7 @@ export const API = {
CHANGE_PASSWORD
:
'cityinterface/rest/services.svc/changepassword'
,
CHANGE_PASSWORD_SAFE
:
'/PandaOMS/OMS/UserCenter/UpdateUserPassword'
,
HD_AUTH_LOGIN
:
'/PandaCore/GCK/BussinessAuth/HDAuthLogin'
,
AUTH_HDU_SER
:
'/PandaWater/CityWater/SJZGX/AuthHDUSer'
,
IOT_CHANGE_PASSWORD
:
'CityInterface/rest/services/OMS.svc/U_UpdatePasswordQuickGCK'
,
FILE_DOWNLOAD
:
'/cityinterface/rest/services/filedownload.svc/download'
,
UPDATE_AVATAR
:
'/CityInterface/rest/services/OMs.svc/U_EditUser'
,
...
...
@@ -89,6 +90,11 @@ const services = {
method
:
constants
.
REQUEST_METHOD_GET
,
type
:
constants
.
REQUEST_HTTP
,
},
AuthHDUSer
:
{
url
:
API
.
AUTH_HDU_SER
,
method
:
constants
.
REQUEST_METHOD_GET
,
type
:
constants
.
REQUEST_HTTP
,
},
authorizationToken
:
{
url
:
API
.
AUTHORIZATION_TOKEN
,
method
:
constants
.
REQUEST_METHOD_GET
,
...
...
src/pages/user/login/noSecret.js
View file @
ee2d6795
...
...
@@ -36,7 +36,13 @@ const Login = forwardRef((props, _ref) => {
});
// 需要在 GetGateWay 和 GetConfig 之后再执行登录。避免信息错落乱
const
hasLogin
=
useRef
();
useEffect
(()
=>
{
const
getAuthDataInfo
=
async
()
=>
{
const
value
=
params
.
getParams
(
'uniwater_utoken'
);
const
hdtoken
=
value
&&
value
!==
'undefined'
?
value
:
null
;
const
authRes
=
hdtoken
?
await
appService
.
AuthHDUSer
({
token
:
hdtoken
,
ignoreSite
:
true
})
:
''
;
return
authRes
?.
data
||
''
;
};
useEffect
(
async
()
=>
{
action
.
globalConfig
=
props
.
global
;
// eslint-disable-next-line no-prototype-builtins
if
(
...
...
@@ -47,11 +53,12 @@ const Login = forwardRef((props, _ref) => {
)
{
hasLogin
.
current
=
true
;
window
.
hasLogin
=
true
;
const
authData
=
!
token
?
await
getAuthDataInfo
()
:
''
;
const
isGZproject
=
window
.
globalConfig
.
subtitle
===
'广州节约用水管理系统'
;
if
(
window
.
globalConfig
&&
window
.
globalConfig
.
hasGateWay
&&
!
isGZproject
)
{
appService
.
authorizationToken
({
loginName
:
token
,
loginName
:
token
||
authData
,
type
:
'token'
,
generateType
:
params
.
getParams
(
'generateType'
)
||
''
,
})
...
...
src/render.js
View file @
ee2d6795
...
...
@@ -63,9 +63,15 @@ export const AppInitState = () => {
const
token
=
value
&&
value
!==
'undefined'
?
value
:
null
;
return
token
;
};
const
getHDToken
=
()
=>
{
const
value
=
params
.
getParams
(
'uniwater_utoken'
);
const
hdtoken
=
value
&&
value
!==
'undefined'
?
value
:
null
;
return
hdtoken
;
};
const
client
=
getClient
();
const
token
=
getUrlToken
();
const
HDtoken
=
getHDToken
();
if
(
sessionStorage
.
getItem
(
'client'
)
!==
client
)
{
sessionStorage
.
setItem
(
'client'
,
client
);
}
...
...
@@ -174,7 +180,7 @@ export const AppInitState = () => {
}
// eslint-disable-next-line no-new
// 增加免登判定
if
(
!
token
&&
getToken
())
{
if
(
!
token
&&
!
HDtoken
&&
getToken
())
{
// eslint-disable-next-line no-new
const
action
=
new
Login
(
{
...
...
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