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
ab364750
Commit
ab364750
authored
Mar 28, 2025
by
周宏民
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改集成登录跳转的问题,在子站是否开启缓存一至的情况,跳转成功
parent
e0f95ca1
Pipeline
#96568
passed with stages
Changes
7
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
50 additions
and
42 deletions
+50
-42
index.js
src/components/IntegratedSwitch/index.js
+7
-10
BasicLayout.js
src/layouts/BasicLayout.js
+1
-1
index.js
src/pages/bootpage/template/integrationNew/index.js
+6
-6
index.js
src/pages/bootpage/template/project/jianshi/index.js
+5
-5
index.js
src/pages/bootpage/template/project/wuliangye/index.js
+15
-12
login.js
src/pages/user/login/login.js
+7
-3
render.js
src/render.js
+9
-5
No files found.
src/components/IntegratedSwitch/index.js
View file @
ab364750
...
@@ -215,7 +215,7 @@ const IntegratedSwitch = props => {
...
@@ -215,7 +215,7 @@ const IntegratedSwitch = props => {
}
}
// props.instance && props.instance.updateConfig(config);
// props.instance && props.instance.updateConfig(config);
loginAction && loginAction.getUserInfoAndConfig('', true,
item.type
);
loginAction && loginAction.getUserInfoAndConfig('', true,
'industrySwitch'
);
});
});
} else {
} else {
setJumpLoading(true);
setJumpLoading(true);
...
@@ -246,30 +246,27 @@ const IntegratedSwitch = props => {
...
@@ -246,30 +246,27 @@ const IntegratedSwitch = props => {
useEffect(() => {
useEffect(() => {
const handleToggleIndustry = event => {
const handleToggleIndustry = event => {
setJumpLoading(false);
jumpProgressEnd();
let url = '';
let url = '';
const { pathname } = window.location;
const { pathname } = window.location;
if (window.clientInfo?.url && window.clientInfo.subType === '内链') {
if (window.clientInfo?.url && window.clientInfo.subType === '内链') {
if (pathname.indexOf('/civbase/thirdParty') === -1) {
// 上一个也是站内跳转,则可直接用 BasicLayout 里的跳转
return;
}
// 上个子站不是站外链接,可直接用跳转
// 上个子站不是站外链接,可直接用跳转
url = searchUrl(window.clientInfo.url);
url = searchUrl(window.clientInfo.url);
window.clientInfo = null;
}
}
history.push(`
/
?
client
=
$
{
clientRef
.
current
||
props
.
global
.
client
||
''
}
`);
history.push(`
/
?
client
=
$
{
clientRef
.
current
||
props
.
global
.
client
||
''
}
`);
props.updateCurrentIndex(0);
props.updateCurrentIndex
&& props.updateCurrentIndex
(0);
defaultApp(url);
defaultApp(url);
setJumpLoading(false);
jumpProgressEnd();
};
};
const handleError = () => {
const handleError = () => {
setJumpLoading(false);
setJumpLoading(false);
jumpProgressEnd();
jumpProgressEnd();
};
};
loginAction.events.on('
toggleIndustry
', handleToggleIndustry);
loginAction.events.on('
industrySwitchSuccess
', handleToggleIndustry);
loginAction.events.on('loginError', handleError);
loginAction.events.on('loginError', handleError);
return () => {
return () => {
loginAction.events.removeListener('
toggleIndustry
', handleToggleIndustry);
loginAction.events.removeListener('
industrySwitchSuccess
', handleToggleIndustry);
loginAction && loginAction.events && loginAction.events.removeListener('loginError', handleError);
loginAction && loginAction.events && loginAction.events.removeListener('loginError', handleError);
};
};
}, [loginAction.events, props]);
}, [loginAction.events, props]);
...
...
src/layouts/BasicLayout.js
View file @
ab364750
...
@@ -511,7 +511,7 @@ const Layout = props => {
...
@@ -511,7 +511,7 @@ const Layout = props => {
// 至少2个行业才能回到引导页
// 至少2个行业才能回到引导页
const
Industries
=
props
.
global
.
get
(
'userInfo.Industries'
);
const
Industries
=
props
.
global
.
get
(
'userInfo.Industries'
);
if
(
Industries
&&
Industries
.
length
>
1
)
{
if
(
Industries
&&
Industries
.
length
>
1
)
{
window
.
qiankunIsCache
=
false
;
//
window.qiankunIsCache = false;
history
.
push
(
'/industry'
);
history
.
push
(
'/industry'
);
}
}
};
};
...
...
src/pages/bootpage/template/integrationNew/index.js
View file @
ab364750
...
@@ -64,8 +64,8 @@ const IntegrationNew = props => {
...
@@ -64,8 +64,8 @@ const IntegrationNew = props => {
const
[
integrationData
,
setIntegrationData
]
=
useState
([]);
// 所有子站
const
[
integrationData
,
setIntegrationData
]
=
useState
([]);
// 所有子站
const
[
linkUrl
,
setLinkUrl
]
=
useState
(
''
);
const
[
linkUrl
,
setLinkUrl
]
=
useState
(
''
);
// 解决 切换 client 时,updateConfig时,页会刷新,loading会重置
// 解决 切换 client 时,updateConfig时,页会刷新,loading会重置
const
[
jumpLoading
,
setJumpLoading
]
=
useState
(
!!
window
.
jumpLoadingProgress
);
const
[
jumpLoading
,
setJumpLoading
]
=
useState
(
false
);
const
[
progressValue2
,
setProgressValue2
]
=
useState
(
window
.
jumpLoadingProgress
||
0
);
const
[
progressValue2
,
setProgressValue2
]
=
useState
(
0
);
const
[
showBackBtn
,
setShowBackBtn
]
=
useState
(
true
);
// 是否显示iframe 返回按钮,三维平台用
const
[
showBackBtn
,
setShowBackBtn
]
=
useState
(
true
);
// 是否显示iframe 返回按钮,三维平台用
const
jumpProgressStart
=
()
=>
{
const
jumpProgressStart
=
()
=>
{
...
@@ -226,12 +226,12 @@ const IntegrationNew = props => {
...
@@ -226,12 +226,12 @@ const IntegrationNew = props => {
setJumpLoading(true);
setJumpLoading(true);
jumpProgressStart();
jumpProgressStart();
startTiming(loadingTime);
startTiming(loadingTime);
window.jumpLoadingProgress = 99;
//
window.jumpLoadingProgress = 99;
// if (loginA.globalConfig?.size === 0 && window.globalConfig) {
// if (loginA.globalConfig?.size === 0 && window.globalConfig) {
// loginA.updateConfig(window.globalConfig);
// loginA.updateConfig(window.globalConfig);
// }
// }
loginA && loginA.getUserInfoAndConfig('', true
, item.type
);
loginA && loginA.getUserInfoAndConfig('', true);
};
};
const onLink = (item, loginA) => {
const onLink = (item, loginA) => {
const token = props.global?.token || Cookies.get('token');
const token = props.global?.token || Cookies.get('token');
...
@@ -387,11 +387,11 @@ const IntegrationNew = props => {
...
@@ -387,11 +387,11 @@ const IntegrationNew = props => {
jumpProgressEnd();
jumpProgressEnd();
window.jumpLoadingProgress = 0;
window.jumpLoadingProgress = 0;
};
};
loginAction.events.on('
toggleIndustry
', handleToggleIndustry);
loginAction.events.on('
loginSuccess
', handleToggleIndustry);
loginAction.events.on('loginError', handleError);
loginAction.events.on('loginError', handleError);
return () => {
return () => {
loginAction && loginAction.events && loginAction.events.removeListener('
toggleIndustry
', handleToggleIndustry);
loginAction && loginAction.events && loginAction.events.removeListener('
loginSuccess
', handleToggleIndustry);
loginAction && loginAction.events && loginAction.events.removeListener('loginError', handleError);
loginAction && loginAction.events && loginAction.events.removeListener('loginError', handleError);
};
};
}, [loginAction.events, props]);
}, [loginAction.events, props]);
...
...
src/pages/bootpage/template/project/jianshi/index.js
View file @
ab364750
...
@@ -218,7 +218,7 @@ const IntegrationJianshi = props => {
...
@@ -218,7 +218,7 @@ const IntegrationJianshi = props => {
jumpProgressStart();
jumpProgressStart();
startTiming(loadingTime);
startTiming(loadingTime);
window.jumpLoadingProgress = 99;
window.jumpLoadingProgress = 99;
loginA && loginA.getUserInfoAndConfig('', true
, item.type
);
loginA && loginA.getUserInfoAndConfig('', true);
};
};
const onLink = (item, loginA) => {
const onLink = (item, loginA) => {
if (!item) return message.info('未配置权限,请联系管理人员');
if (!item) return message.info('未配置权限,请联系管理人员');
...
@@ -272,8 +272,6 @@ const IntegrationJianshi = props => {
...
@@ -272,8 +272,6 @@ const IntegrationJianshi = props => {
}, []);
}, []);
useEffect(() => {
useEffect(() => {
const handleToggleIndustry = event => {
const handleToggleIndustry = event => {
setJumpLoading(false);
jumpProgressEnd();
window.jumpLoadingProgress = 0;
window.jumpLoadingProgress = 0;
let url = '';
let url = '';
if (window.clientInfo?.url && window.clientInfo.subType === '内链') {
if (window.clientInfo?.url && window.clientInfo.subType === '内链') {
...
@@ -283,17 +281,19 @@ const IntegrationJianshi = props => {
...
@@ -283,17 +281,19 @@ const IntegrationJianshi = props => {
props.history.push(`
/
?
client
=
$
{
clientRef
.
current
||
props
.
global
.
client
}
`);
props.history.push(`
/
?
client
=
$
{
clientRef
.
current
||
props
.
global
.
client
}
`);
props.updateCurrentIndex && props.updateCurrentIndex(0);
props.updateCurrentIndex && props.updateCurrentIndex(0);
defaultApp(url);
defaultApp(url);
setJumpLoading(false);
jumpProgressEnd();
};
};
const handleError = () => {
const handleError = () => {
setJumpLoading(false);
setJumpLoading(false);
jumpProgressEnd();
jumpProgressEnd();
};
};
loginAction.events.on('
toggleIndustry
', handleToggleIndustry);
loginAction.events.on('
loginSuccess
', handleToggleIndustry);
loginAction.events.on('loginError', handleError);
loginAction.events.on('loginError', handleError);
return () => {
return () => {
loginAction && loginAction.events && loginAction.events.removeListener('
toggleIndustry
', handleToggleIndustry);
loginAction && loginAction.events && loginAction.events.removeListener('
loginSuccess
', handleToggleIndustry);
loginAction && loginAction.events && loginAction.events.removeListener('loginError', handleError);
loginAction && loginAction.events && loginAction.events.removeListener('loginError', handleError);
};
};
}, [loginAction.events, props]);
}, [loginAction.events, props]);
...
...
src/pages/bootpage/template/project/wuliangye/index.js
View file @
ab364750
...
@@ -71,8 +71,8 @@ const IntegrationQinzhou = props => {
...
@@ -71,8 +71,8 @@ const IntegrationQinzhou = props => {
boxHeight
:
930
,
boxHeight
:
930
,
});
});
const
[
linkUrl
,
setLinkUrl
]
=
useState
(
''
);
const
[
linkUrl
,
setLinkUrl
]
=
useState
(
''
);
const
[
jumpLoading
,
setJumpLoading
]
=
useState
(
!!
window
.
jumpLoadingProgress
);
const
[
jumpLoading
,
setJumpLoading
]
=
useState
(
false
);
const
[
progressValue2
,
setProgressValue2
]
=
useState
(
window
.
jumpLoadingProgress
||
0
);
const
[
progressValue2
,
setProgressValue2
]
=
useState
(
0
);
const
[
showBackBtn
,
setShowBackBtn
]
=
useState
(
false
);
// 是否显示iframe 返回按钮,三维平台用
const
[
showBackBtn
,
setShowBackBtn
]
=
useState
(
false
);
// 是否显示iframe 返回按钮,三维平台用
const
[
loginAction
,
setAction
]
=
useState
(()
=>
new
LoginAction
(
props
));
const
[
loginAction
,
setAction
]
=
useState
(()
=>
new
LoginAction
(
props
));
...
@@ -174,7 +174,7 @@ const IntegrationQinzhou = props => {
...
@@ -174,7 +174,7 @@ const IntegrationQinzhou = props => {
const
toRevenue
=
async
item
=>
{
const
toRevenue
=
async
item
=>
{
setJumpLoading
(
true
);
setJumpLoading
(
true
);
jumpProgressStart
();
jumpProgressStart
();
startTiming
(
6
);
startTiming
(
10
);
window
.
jumpLoadingProgress
=
99
;
window
.
jumpLoadingProgress
=
99
;
try
{
try
{
const
res
=
await
appService
.
getTicketByToken
({
token
:
window
.
globalConfig
?.
token
});
const
res
=
await
appService
.
getTicketByToken
({
token
:
window
.
globalConfig
?.
token
});
...
@@ -243,8 +243,11 @@ const IntegrationQinzhou = props => {
...
@@ -243,8 +243,11 @@ const IntegrationQinzhou = props => {
setJumpLoading(true);
setJumpLoading(true);
jumpProgressStart();
jumpProgressStart();
startTiming(loadingTime);
startTiming(loadingTime);
window.jumpLoadingProgress = 99;
// window.jumpLoadingProgress = 99;
loginA && loginA.getUserInfoAndConfig('', true, item.type);
// if (loginA.globalConfig?.size === 0 && window.globalConfig) {
// loginA.updateConfig(window.globalConfig);
// }
loginA && loginA.getUserInfoAndConfig('', true);
};
};
const onLink = (item, loginA) => {
const onLink = (item, loginA) => {
if (!item) return;
if (!item) return;
...
@@ -317,10 +320,8 @@ const IntegrationQinzhou = props => {
...
@@ -317,10 +320,8 @@ const IntegrationQinzhou = props => {
}, []);
}, []);
useEffect(() => {
useEffect(() => {
const handleToggleIndustry = event => {
const handleToggleIndustry = event => {
setJumpLoading(false);
jumpProgressEnd();
window.jumpLoadingProgress = 0;
window.jumpLoadingProgress = 0;
window.jumpLoadingProgress = 0;
let url = '';
let url = '';
if (window.clientInfo?.url && window.clientInfo.subType === '内链') {
if (window.clientInfo?.url && window.clientInfo.subType === '内链') {
url = searchUrl(window.clientInfo.url);
url = searchUrl(window.clientInfo.url);
...
@@ -328,22 +329,24 @@ const IntegrationQinzhou = props => {
...
@@ -328,22 +329,24 @@ const IntegrationQinzhou = props => {
}
}
props.history.push(`
/
?
client
=
$
{
clientRef
.
current
||
props
.
global
.
client
}
`);
props.history.push(`
/
?
client
=
$
{
clientRef
.
current
||
props
.
global
.
client
}
`);
props.updateCurrentIndex && props.updateCurrentIndex(0);
props.updateCurrentIndex && props.updateCurrentIndex(0);
defaultApp(url);
defaultApp(url);
setJumpLoading(false);
jumpProgressEnd();
};
};
const handleError = () => {
const handleError = () => {
window.jumpLoadingProgress = 0;
window.jumpLoadingProgress = 0;
setJumpLoading(false);
setJumpLoading(false);
jumpProgressEnd();
jumpProgressEnd();
};
};
loginAction.events.on('loginSuccess', handleToggleIndustry);
loginAction.events.on('toggleIndustry', handleToggleIndustry);
loginAction.events.on('loginError', handleError);
loginAction.events.on('loginError', handleError);
return () => {
return () => {
loginAction && loginAction.events && loginAction.events.removeListener('
toggleIndustry
', handleToggleIndustry);
loginAction && loginAction.events && loginAction.events.removeListener('
loginSuccess
', handleToggleIndustry);
loginAction && loginAction.events && loginAction.events.removeListener('loginError', handleError);
loginAction && loginAction.events && loginAction.events.removeListener('loginError', handleError);
};
};
}, [
loginAction.events, props
]);
}, []);
return (
return (
<div className={classNames(styles.integrationQinzhou, 'integrationQinzhou')} style={{ background: `
url
(
$
{
BGIcon
})
center
/
100
%
100
%
no
-
repeat
` }} ref={ref} >
<div className={classNames(styles.integrationQinzhou, 'integrationQinzhou')} style={{ background: `
url
(
$
{
BGIcon
})
center
/
100
%
100
%
no
-
repeat
` }} ref={ref} >
...
...
src/pages/user/login/login.js
View file @
ab364750
...
@@ -338,12 +338,12 @@ class Login {
...
@@ -338,12 +338,12 @@ class Login {
}
}
writeLogs
()
{
writeLogs
()
{
if
(
this
.
globalConfig
.
userInfo
.
UserImge
===
''
)
{
if
(
this
.
globalConfig
?.
userInfo
?
.
UserImge
===
''
)
{
// _config.userInfo.UserImge = __webpack_public_path__ + "assets/images/icon/熊猫新2.png";
// _config.userInfo.UserImge = __webpack_public_path__ + "assets/images/icon/熊猫新2.png";
this
.
globalConfig
.
userInfo
.
UserImge
=
'https://panda-water.cn/web4/assets/images/icon/熊猫新2.png'
;
this
.
globalConfig
.
userInfo
.
UserImge
=
'https://panda-water.cn/web4/assets/images/icon/熊猫新2.png'
;
}
}
if
(
this
.
globalConfig
.
userInfo
.
site
)
{
if
(
this
.
globalConfig
?.
userInfo
?
.
site
)
{
// eslint-disable-next-line no-undef
// eslint-disable-next-line no-undef
appService
appService
.
writeLogs
({
.
writeLogs
({
...
@@ -401,7 +401,6 @@ class Login {
...
@@ -401,7 +401,6 @@ class Login {
return
false
;
return
false
;
}
}
}
}
this
.
initGateWay
(
token
,
getIndustry
);
this
.
initGateWay
(
token
,
getIndustry
);
}
}
...
@@ -767,7 +766,12 @@ class Login {
...
@@ -767,7 +766,12 @@ class Login {
finish
(
self
,
getIndustry
)
{
finish
(
self
,
getIndustry
)
{
window
.
finishRender
=
true
;
window
.
finishRender
=
true
;
if
(
getIndustry
===
'industrySwitch'
)
{
// 组件中 站点跳转
self
.
events
.
emit
(
'industrySwitchSuccess'
);
}
else
{
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
();
}
}
...
...
src/render.js
View file @
ab364750
...
@@ -19,7 +19,7 @@ import { actionCreators } from './containers/App/store';
...
@@ -19,7 +19,7 @@ import { actionCreators } from './containers/App/store';
import
{
defaultApp
,
findMenuPath
}
from
'./micro'
;
import
{
defaultApp
,
findMenuPath
}
from
'./micro'
;
import
Login
from
'./pages/user/login/login'
;
import
Login
from
'./pages/user/login/login'
;
import
store
from
'./stores'
;
import
store
from
'./stores'
;
import
{
getToken
}
from
'./utils/utils'
;
import
{
getToken
,
searchUrl
}
from
'./utils/utils'
;
const
{
getThemeVariables
}
=
require
(
'antd/dist/theme'
);
const
{
getThemeVariables
}
=
require
(
'antd/dist/theme'
);
const
defaultSetting
=
require
(
'../config/defaultSetting'
);
const
defaultSetting
=
require
(
'../config/defaultSetting'
);
...
@@ -45,7 +45,7 @@ function getStyle(prefixCls, theme) {
...
@@ -45,7 +45,7 @@ function getStyle(prefixCls, theme) {
`
.
trim
();
`
.
trim
();
}
}
const
registerTheme
=
function
(
prefixCls
,
theme
)
{
const
registerTheme
=
function
(
prefixCls
,
theme
)
{
const
style
=
getStyle
(
prefixCls
,
theme
);
const
style
=
getStyle
(
prefixCls
,
theme
);
if
(
canUseDom
())
{
if
(
canUseDom
())
{
updateCSS
(
style
,
`
${
dynamicStyleMark
}
-dynamic-theme`
);
updateCSS
(
style
,
`
${
dynamicStyleMark
}
-dynamic-theme`
);
...
@@ -149,6 +149,10 @@ export const AppInitState = () => {
...
@@ -149,6 +149,10 @@ export const AppInitState = () => {
if
(
data
.
webState
===
'1'
||
data
.
webState
===
'3'
)
{
if
(
data
.
webState
===
'1'
||
data
.
webState
===
'3'
)
{
data
.
isIntegration
=
'1'
;
data
.
isIntegration
=
'1'
;
}
}
window
.
qiankunIsCache
=
window
.
location
.
origin
.
replace
(
/^
(
http|https
)
:
\/\/
/
,
''
)
===
'panda-water.cn'
?
false
:
data
.
isCache
||
false
;
const
serverRes
=
await
appService
.
getMainServer
();
const
serverRes
=
await
appService
.
getMainServer
();
const
serverData
=
serverRes
?.
data
||
[];
const
serverData
=
serverRes
?.
data
||
[];
const
mainserverConf
=
serverData
.
find
(
item
=>
item
.
name
===
'mainserver'
);
const
mainserverConf
=
serverData
.
find
(
item
=>
item
.
name
===
'mainserver'
);
...
@@ -259,7 +263,7 @@ export const AppInitState = () => {
...
@@ -259,7 +263,7 @@ export const AppInitState = () => {
const
initMessageVoice
=
()
=>
{
const
initMessageVoice
=
()
=>
{
if
(
!
window
.
speechSynthesis
)
return
;
if
(
!
window
.
speechSynthesis
)
return
;
const
rawSpeak
=
window
.
speechSynthesis
.
speak
;
const
rawSpeak
=
window
.
speechSynthesis
.
speak
;
window
.
speechSynthesis
.
speak
=
function
(...
args
)
{
window
.
speechSynthesis
.
speak
=
function
(...
args
)
{
if
(
if
(
window
.
globalConfig
&&
window
.
globalConfig
&&
// eslint-disable-next-line no-prototype-builtins
// eslint-disable-next-line no-prototype-builtins
...
@@ -286,9 +290,9 @@ export const AppInitState = () => {
...
@@ -286,9 +290,9 @@ export const AppInitState = () => {
return
true
;
return
true
;
};
};
store
.
subscribe
(
store
.
subscribe
(
(
function
()
{
(
function
()
{
const
preVariableTheme
=
store
.
getState
().
toJS
().
global
?.
globalConfig
?.
variableTheme
;
const
preVariableTheme
=
store
.
getState
().
toJS
().
global
?.
globalConfig
?.
variableTheme
;
return
function
()
{
return
function
()
{
// if (!preVariableTheme)
// if (!preVariableTheme)
const
variableTheme
=
store
.
getState
().
toJS
().
global
?.
globalConfig
?.
variableTheme
;
const
variableTheme
=
store
.
getState
().
toJS
().
global
?.
globalConfig
?.
variableTheme
;
if
(
!
hasThemeChanged
(
preVariableTheme
,
variableTheme
))
return
false
;
if
(
!
hasThemeChanged
(
preVariableTheme
,
variableTheme
))
return
false
;
...
...
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