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