mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2025-04-06 03:59:53 +08:00
* fix: 判断页面权限的path统一从match中拿路由path * fix: qiankun主应用不改rootContainer * fix: 消除initialState为空时的warn * refactor: modifyCreateHistroy更改为modifyCreateHistory * fix: qiankun支持多页签keepalive
34 lines
872 B
Smarty
34 lines
872 B
Smarty
import { createMemoryHistory, getHistory } from '@@/core/coreExports';
|
||
import qiankunRender, { clientRenderOptsStack, history } from './lifecycles';
|
||
|
||
|
||
export const render = oldRender => qiankunRender().then(oldRender);
|
||
|
||
export function modifyClientRenderOpts(memo) {
|
||
// 每次应用 render 的时候会调 modifyClientRenderOpts,这时尝试从队列中取 render 的配置
|
||
const clientRenderOpts = clientRenderOptsStack.shift();
|
||
|
||
return {
|
||
...memo,
|
||
...clientRenderOpts
|
||
};
|
||
}
|
||
|
||
export function modifyCreateHistory(memo) {
|
||
if (history.url) {
|
||
return createMemoryHistory
|
||
}
|
||
return memo;
|
||
}
|
||
|
||
export function onRouterCreated({ router }) {
|
||
if(history.url) {
|
||
const memoryHistory = getHistory();
|
||
memoryHistory.push(history.url)
|
||
}
|
||
if(history.onRouterInit){
|
||
history.onRouterInit(router)
|
||
}
|
||
}
|
||
|