@@ -76,7 +76,7 @@ function withAsyncRegionList<P extends IConsoleContextProp, S = {}>(
76
76
const { region : { regionList : userRegionListConfig } = { } , location, match, history, appConfig } = props ;
77
77
const [ loading , setLoading ] = useState ( isFunction ( userRegionListConfig ) ) ;
78
78
const [ regionList , setRegionList ] = useState ( isFunction ( userRegionListConfig ) ? [ ] : userRegionListConfig as IPayloadRegion [ ] ) ;
79
- const lastMatchUrl = useRef ( '' ) ;
79
+ const lastPathname = useRef ( '' ) ;
80
80
81
81
const { customPaths = [ ] } = appConfig ?. aplus || { } ;
82
82
@@ -95,13 +95,11 @@ function withAsyncRegionList<P extends IConsoleContextProp, S = {}>(
95
95
useEffect ( ( ) => {
96
96
const aplusConfig = ( window as unknown as IWin ) . APLUS_CONFIG || { } ;
97
97
98
- if ( lastMatchUrl . current === history . location . pathname ) return ;
99
- lastMatchUrl . current = history . location . pathname ;
98
+ if ( lastPathname . current === history . location . pathname ) return ;
99
+ lastPathname . current = history . location . pathname ;
100
100
101
101
const { spmbPrefix } = aplusConfig ;
102
102
103
- const matchPath = match . isExact ? match . path : matchCustomPath ( customPaths , history . location . pathname ) || match . path ;
104
-
105
103
if ( spmbPrefix ) {
106
104
// @ts -ignore
107
105
// eslint-disable-next-line @typescript-eslint/camelcase
@@ -110,6 +108,7 @@ function withAsyncRegionList<P extends IConsoleContextProp, S = {}>(
110
108
// 由于 aplus 不是实时发送,存在时延,故需要特殊处理重定向场景
111
109
( ( url ) => {
112
110
setTimeout ( ( ) => {
111
+ const matchPath = matchCustomPath ( customPaths , history . location . pathname ) || match . path ;
113
112
// url 不等,说明发生了重定向或者用户快速的跳转
114
113
if ( url === window . location . href ) {
115
114
// 延迟发送
0 commit comments