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
317eb79c
Commit
317eb79c
authored
Jun 06, 2024
by
杨思琦
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:云平台登录逻辑修改
parent
3df34b6e
Pipeline
#89566
waiting for manual action with stages
Changes
8
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
45 additions
and
13 deletions
+45
-13
BasicLayout.js
src/layouts/BasicLayout.js
+3
-0
SecurityLayout.js
src/layouts/SecurityLayout.js
+7
-6
micro.js
src/micro.js
+6
-0
login.js
src/pages/bootpage/demonstration/components/login.js
+2
-0
login.js
src/pages/user/login/login.js
+13
-4
noSecret.js
src/pages/user/login/noSecret.js
+5
-0
baseLogin.js
src/pages/user/login/template/baseLogin.js
+4
-1
render.js
src/render.js
+5
-2
No files found.
src/layouts/BasicLayout.js
View file @
317eb79c
...
@@ -825,6 +825,9 @@ const mapDispatchToProps = dispatch => ({
...
@@ -825,6 +825,9 @@ const mapDispatchToProps = dispatch => ({
logout() {
logout() {
dispatch(actionCreators.logout());
dispatch(actionCreators.logout());
},
},
createContext(data) {
dispatch(actionCreators.createContext(data));
},
});
});
export default connect(
export default connect(
mapStateToProps,
mapStateToProps,
...
...
src/layouts/SecurityLayout.js
View file @
317eb79c
...
@@ -64,12 +64,13 @@ class SecurityLayout extends React.Component {
...
@@ -64,12 +64,13 @@ class SecurityLayout extends React.Component {
const
{
children
,
global
,
loading
}
=
this
.
props
;
const
{
children
,
global
,
loading
}
=
this
.
props
;
const
tk
=
Cookies
.
get
(
'token'
)
||
global
.
token
;
const
tk
=
Cookies
.
get
(
'token'
)
||
global
.
token
;
const
isLogin
=
tk
!==
null
&&
tk
!==
'undefined'
&&
tk
!==
void
0
;
const
isLogin
=
tk
!==
null
&&
tk
!==
'undefined'
&&
tk
!==
void
0
;
const
{
pathname
}
=
history
.
location
;
if
(
isLogin
&&
window
.
location
.
pathname
!==
`/civbase/industry`
&&
!
window
.
finishRender
)
{
if
(
if
(
window
.
globalConfig
?.
userInfo
?.
Groups
&&
window
.
globalConfig
?.
Industry
===
''
)
{
(
!
isLogin
&&
window
.
location
.
pathname
!==
'/civbase/user/login'
)
||
return
<
Redirect
to
=
{{
pathname
:
`/industry`
,
state
:
{
reload
:
true
}
}}
exact
/>
;
// eslint-disable-next-line no-prototype-builtins
}
(
global
.
hasOwnProperty
(
'size'
)
&&
global
.
size
===
0
)
return
<
PageLoading
/>
;
)
{
}
if
(
!
isLogin
&&
window
.
location
.
pathname
!==
'/civbase/user/login'
)
{
this
.
props
.
updateCurrentIndex
&&
this
.
props
.
updateCurrentIndex
(
0
);
this
.
props
.
updateCurrentIndex
&&
this
.
props
.
updateCurrentIndex
(
0
);
let
client
=
global
.
client
||
sessionStorage
.
getItem
(
'client'
);
let
client
=
global
.
client
||
sessionStorage
.
getItem
(
'client'
);
client
=
client
!==
'undefined'
&&
!
_
.
isNull
(
client
)
&&
!
_
.
isUndefined
(
client
)
?
client
:
'city'
;
client
=
client
!==
'undefined'
&&
!
_
.
isNull
(
client
)
&&
!
_
.
isUndefined
(
client
)
?
client
:
'city'
;
...
...
src/micro.js
View file @
317eb79c
...
@@ -278,6 +278,7 @@ export const initMicroApps = (url) => {
...
@@ -278,6 +278,7 @@ export const initMicroApps = (url) => {
initSaveMicroApps
(
url
);
initSaveMicroApps
(
url
);
start
(
Configuration
);
start
(
Configuration
);
runAfterFirstMounted
(()
=>
{
runAfterFirstMounted
(()
=>
{
window
.
parent
&&
window
.
parent
.
postMessage
({
type
:
'runAfterFirstMounted'
},
'*'
);
event
.
emit
(
'loading'
,
false
);
event
.
emit
(
'loading'
,
false
);
setTimeout
(()
=>
{
setTimeout
(()
=>
{
prefetchApps
(
micro
);
prefetchApps
(
micro
);
...
@@ -294,6 +295,11 @@ export const initMicroApps = (url) => {
...
@@ -294,6 +295,11 @@ export const initMicroApps = (url) => {
setTimeout
(()
=>
{
setTimeout
(()
=>
{
url
.
indexOf
(
'civbase/civ_base'
)
>
-
1
&&
event
.
emit
(
'loading'
,
false
)
url
.
indexOf
(
'civbase/civ_base'
)
>
-
1
&&
event
.
emit
(
'loading'
,
false
)
})
})
runAfterFirstMounted
(()
=>
{
window
.
parent
&&
window
.
parent
.
postMessage
({
type
:
'runAfterFirstMounted'
},
'*'
);
event
.
emit
(
'loading'
,
false
);
Logger
.
info
(
'[MainApp] first app mounted'
);
});
addGlobalUncaughtErrorHandler
(
event
=>
{
addGlobalUncaughtErrorHandler
(
event
=>
{
console
.
log
(
event
);
console
.
log
(
event
);
});
});
...
...
src/pages/bootpage/demonstration/components/login.js
View file @
317eb79c
...
@@ -459,6 +459,7 @@ class Login {
...
@@ -459,6 +459,7 @@ class Login {
finish
(
self
,
getIndustry
)
{
finish
(
self
,
getIndustry
)
{
self
.
events
.
emit
(
'onendLoading'
);
self
.
events
.
emit
(
'onendLoading'
);
setTimeout
(()
=>
{
setTimeout
(()
=>
{
window
.
finishRender
=
true
;
getIndustry
?
self
.
events
.
emit
(
'toggleIndustry'
)
:
self
.
events
.
emit
(
'loginSuccess'
);
getIndustry
?
self
.
events
.
emit
(
'toggleIndustry'
)
:
self
.
events
.
emit
(
'loginSuccess'
);
window
.
share
.
event
=
self
.
events
;
window
.
share
.
event
=
self
.
events
;
self
.
callback
&&
self
.
callback
();
self
.
callback
&&
self
.
callback
();
...
@@ -639,6 +640,7 @@ class Login {
...
@@ -639,6 +640,7 @@ class Login {
}
}
getUserInfoAndConfig
(
failCallback
,
flag
,
industry
,
toSite
)
{
getUserInfoAndConfig
(
failCallback
,
flag
,
industry
,
toSite
)
{
this
.
updateConfig
(
window
.
globalConfig
);
const
{
token
:
tk
}
=
this
.
globalConfig
;
const
{
token
:
tk
}
=
this
.
globalConfig
;
const
token
=
tk
||
Cookies
.
get
(
'token'
);
const
token
=
tk
||
Cookies
.
get
(
'token'
);
const
site
=
Cookies
.
get
(
'site'
);
const
site
=
Cookies
.
get
(
'site'
);
...
...
src/pages/user/login/login.js
View file @
317eb79c
...
@@ -276,6 +276,7 @@ class Login {
...
@@ -276,6 +276,7 @@ class Login {
getUserInfo
(
param
)
getUserInfo
(
param
)
.
then
(
response
=>
{
.
then
(
response
=>
{
if
(
response
&&
response
.
code
===
0
)
{
if
(
response
&&
response
.
code
===
0
)
{
self
.
isSignIn
=
true
;
self
.
globalConfig
.
userInfo
=
window
?.
globalConfig
?.
transformUserInfo
?.(
response
.
data
)
??
{};
self
.
globalConfig
.
userInfo
=
window
?.
globalConfig
?.
transformUserInfo
?.(
response
.
data
)
??
{};
self
.
updateConfig
&&
self
.
updateConfig
(
self
.
globalConfig
);
self
.
updateConfig
&&
self
.
updateConfig
(
self
.
globalConfig
);
self
.
getUserInfoAndConfig
();
self
.
getUserInfoAndConfig
();
...
@@ -345,15 +346,21 @@ class Login {
...
@@ -345,15 +346,21 @@ class Login {
});
});
}
}
// eslint-disable-next-line prettier/prettier
// eslint-disable-next-line prettier/prettier
if
(
!
flag
&&
this
.
isSignIn
&&
this
.
globalConfig
.
userInfo
.
Industries
.
length
&&
this
.
globalConfig
.
userInfo
.
Industries
.
length
>
1
)
{
if
(
!
flag
&&
this
.
isSignIn
&&
this
.
globalConfig
.
userInfo
.
Industries
.
length
&&
this
.
globalConfig
.
userInfo
.
Industries
.
length
>
1
&&
!
window
.
qiankunStarted
)
{
this
.
createContext
(
this
);
this
.
createContext
(
this
);
this
.
updateConfig
&&
this
.
updateConfig
(
this
.
globalConfig
);
this
.
updateConfig
&&
this
.
updateConfig
(
this
.
globalConfig
);
this
.
history
.
push
(
'/i
ndustry'
);
this
.
events
&&
this
.
events
.
emit
(
'loginI
ndustry'
);
return
false
;
return
false
;
}
}
// 跳转到集成登录引导页_xule_2023-08-28
// 跳转到集成登录引导页_xule_2023-08-28
if
(
!
flag
&&
this
.
isSignIn
&&
this
.
globalConfig
.
isIntegration
>=
1
&&
this
.
integratedNum
>=
2
)
{
if
(
this
.
history
.
push
(
'/industry'
);
!
flag
&&
this
.
isSignIn
&&
this
.
globalConfig
.
isIntegration
>=
1
&&
this
.
integratedNum
>=
2
&&
!
window
.
qiankunStarted
)
{
this
.
events
&&
this
.
events
.
emit
(
'loginIndustry'
);
return
false
;
return
false
;
}
}
this
.
initGateWay
(
token
,
getIndustry
);
this
.
initGateWay
(
token
,
getIndustry
);
...
@@ -707,6 +714,7 @@ class Login {
...
@@ -707,6 +714,7 @@ class Login {
}
}
finish
(
self
,
getIndustry
)
{
finish
(
self
,
getIndustry
)
{
window
.
finishRender
=
true
;
getIndustry
?
self
.
events
.
emit
(
'toggleIndustry'
)
:
self
.
events
.
emit
(
'loginSuccess'
);
getIndustry
?
self
.
events
.
emit
(
'toggleIndustry'
)
:
self
.
events
.
emit
(
'loginSuccess'
);
window
.
share
.
event
=
self
.
events
;
window
.
share
.
event
=
self
.
events
;
self
.
callback
&&
self
.
callback
();
self
.
callback
&&
self
.
callback
();
...
@@ -752,6 +760,7 @@ class Login {
...
@@ -752,6 +760,7 @@ class Login {
if
(
transitionPage
.
content
.
length
>
0
)
{
if
(
transitionPage
.
content
.
length
>
0
)
{
self
.
globalConfig
.
transitionPage
=
transitionPage
;
self
.
globalConfig
.
transitionPage
=
transitionPage
;
self
.
updateConfig
&&
self
.
updateConfig
(
self
.
globalConfig
);
self
.
updateConfig
&&
self
.
updateConfig
(
self
.
globalConfig
);
window
.
finishRender
=
true
;
self
.
events
.
emit
(
'loginHomePage'
);
self
.
events
.
emit
(
'loginHomePage'
);
window
.
share
.
event
=
self
.
events
;
window
.
share
.
event
=
self
.
events
;
return
self
.
callback
&&
self
.
callback
();
return
self
.
callback
&&
self
.
callback
();
...
...
src/pages/user/login/noSecret.js
View file @
317eb79c
...
@@ -84,8 +84,12 @@ const Login = forwardRef((props, _ref) => {
...
@@ -84,8 +84,12 @@ const Login = forwardRef((props, _ref) => {
},
[
action
,
action
.
globalConfig
,
props
.
global
]);
},
[
action
,
action
.
globalConfig
,
props
.
global
]);
useEffect
(()
=>
{
useEffect
(()
=>
{
action
.
events
.
on
(
'loginError'
,
event
=>
{
window
.
parent
&&
window
.
parent
.
postMessage
({
type
:
'loginError'
,
msg
:
event
},
'*'
);
});
action
&&
action
&&
action
.
events
.
on
(
'loginSuccess'
,
event
=>
{
action
.
events
.
on
(
'loginSuccess'
,
event
=>
{
window
.
parent
&&
window
.
parent
.
postMessage
({
type
:
'loginSuccess'
},
'*'
);
// http://127.0.0.1:8080/civbase/civweb4/
// http://127.0.0.1:8080/civbase/civweb4/
props
.
updateConfig
(
props
.
updateConfig
(
Object
.
assign
({},
window
.
globalConfig
,
{
Object
.
assign
({},
window
.
globalConfig
,
{
...
@@ -109,6 +113,7 @@ const Login = forwardRef((props, _ref) => {
...
@@ -109,6 +113,7 @@ const Login = forwardRef((props, _ref) => {
});
});
return
()
=>
{
return
()
=>
{
action
&&
action
.
events
&&
action
.
events
.
removeAllListeners
(
'loginSuccess'
);
action
&&
action
.
events
&&
action
.
events
.
removeAllListeners
(
'loginSuccess'
);
action
&&
action
.
events
&&
action
.
events
.
removeAllListeners
(
'loginError'
);
};
};
},
[
action
,
props
.
global
.
client
,
props
.
global
.
generateType
,
props
.
history
,
redirect
]);
},
[
action
,
props
.
global
.
client
,
props
.
global
.
generateType
,
props
.
history
,
redirect
]);
...
...
src/pages/user/login/template/baseLogin.js
View file @
317eb79c
...
@@ -86,12 +86,15 @@ const Login = forwardRef((props, _ref) => {
...
@@ -86,12 +86,15 @@ const Login = forwardRef((props, _ref) => {
action
.
events
.
on
(
'loginHomePage'
,
()
=>
{
action
.
events
.
on
(
'loginHomePage'
,
()
=>
{
props
.
history
.
push
(
`/homePage`
);
props
.
history
.
push
(
`/homePage`
);
})
})
// }
action
.
events
.
on
(
'loginIndustry'
,
()
=>
{
props
.
history
.
push
(
`/industry`
);
});
return
()
=>
{
return
()
=>
{
action
&&
action
.
events
&&
action
.
events
.
removeAllListeners
(
'loginSuccess'
);
action
&&
action
.
events
&&
action
.
events
.
removeAllListeners
(
'loginSuccess'
);
action
&&
action
.
events
&&
action
.
events
.
removeAllListeners
(
'loginError'
);
action
&&
action
.
events
&&
action
.
events
.
removeAllListeners
(
'loginError'
);
action
&&
action
.
events
&&
action
.
events
.
removeAllListeners
(
'loginVisible'
);
action
&&
action
.
events
&&
action
.
events
.
removeAllListeners
(
'loginVisible'
);
action
&&
action
.
events
&&
action
.
events
.
removeAllListeners
(
'loginHomePage'
);
action
&&
action
.
events
&&
action
.
events
.
removeAllListeners
(
'loginHomePage'
);
action
&&
action
.
events
&&
action
.
events
.
removeAllListeners
(
'loginIndustry'
);
}
}
},
[
props
.
loginMode
]);
},
[
props
.
loginMode
]);
...
...
src/render.js
View file @
317eb79c
...
@@ -186,8 +186,8 @@ export const AppInitState = () => {
...
@@ -186,8 +186,8 @@ export const AppInitState = () => {
},
},
gateWayConfig
,
gateWayConfig
,
),
),
// eslint-disable-next-line no-shadow
createContext
:
value
=>
store
.
dispatch
(
actionCreators
.
createContext
(
value
)),
updateConfig
:
data
=>
store
.
dispatch
(
actionCreators
.
getConfig
(
data
)),
updateConfig
:
value
=>
store
.
dispatch
(
actionCreators
.
getConfig
(
value
)),
isInit
:
false
,
isInit
:
false
,
logout
:
()
=>
store
.
dispatch
(
actionCreators
.
logout
()),
logout
:
()
=>
store
.
dispatch
(
actionCreators
.
logout
()),
},
},
...
@@ -210,6 +210,9 @@ export const AppInitState = () => {
...
@@ -210,6 +210,9 @@ export const AppInitState = () => {
const
url
=
`civbase/
${
findMenuPath
([
allWidgets
[
0
]])}
`
;
const
url
=
`civbase/
${
findMenuPath
([
allWidgets
[
0
]])}
`
;
defaultApp
(
url
);
defaultApp
(
url
);
});
});
action
.
events
.
on
(
'loginIndustry'
,
event
=>
{
window
.
history
.
pushState
(
''
,
''
,
`/civbase/industry`
);
});
}
}
return
window
.
globalConfig
.
variableTheme
;
return
window
.
globalConfig
.
variableTheme
;
}
}
...
...
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