免登录处理
This commit is contained in:
parent
8f4c349c90
commit
59f2bd3095
22
src/app.tsx
22
src/app.tsx
@ -95,6 +95,8 @@ export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState }) =
|
||||
fetchUserInfo?.(setInitialState);
|
||||
}
|
||||
},
|
||||
pure: !!new URLSearchParams(window.location.search), // 删除自带页面
|
||||
// pure:true,
|
||||
links: isDev
|
||||
? [
|
||||
<Link key="openapi" to="/umi/plugin/openapi" target="_blank">
|
||||
@ -123,17 +125,17 @@ export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState }) =
|
||||
return [];
|
||||
}
|
||||
// initialState.currentUser 中包含了所有用户信息
|
||||
let menus = await getRoutersInfo();
|
||||
const menus = await getRoutersInfo();
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const hideInMenu = urlParams.get('hideInMenu'); // 替换 'hideInMenu' 为你要获取的参数名
|
||||
if (hideInMenu) {
|
||||
menus = menus.map((item) => {
|
||||
return {
|
||||
...item,
|
||||
hideInMenu: true,
|
||||
};
|
||||
});
|
||||
}
|
||||
// const hideInMenu = urlParams.get('hideInMenu'); // 替换 'hideInMenu' 为你要获取的参数名
|
||||
// if (hideInMenu) {
|
||||
// menus = menus.map((item) => {
|
||||
// return {
|
||||
// ...item,
|
||||
// hideInMenu: true,
|
||||
// };
|
||||
// });
|
||||
// }
|
||||
setInitialState((preInitialState: any) => ({
|
||||
...preInitialState,
|
||||
menus,
|
||||
|
@ -222,7 +222,7 @@ const KeepAliveTabs = () => {
|
||||
|
||||
return (
|
||||
// <div className={styles.tabs} style={{ width: initialState?.collapsed ? "calc(100vw - 41px)" : "calc(100vw - 249px)" }}>
|
||||
<div className={styles.tabs} id="contentContainer">
|
||||
<div className={!!new URLSearchParams(window.location.search) ? 'hideContent' : styles.tabs} id="contentContainer">
|
||||
{tabList.length > 0 && <SortableList onSortEnd={onSortEnd} axis={'x'} distance={1} />}
|
||||
<div className={`${styles.tabLeftMenu} ${tabList.length >= showTabs && styles.boxShadow}`}>
|
||||
{tabList.length > showTabs && (
|
||||
|
@ -27,6 +27,11 @@ body {
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
|
||||
.hideContent{
|
||||
display: none;
|
||||
}
|
||||
|
||||
ul,
|
||||
ol {
|
||||
list-style: none;
|
||||
|
@ -25,7 +25,7 @@ import './style/index.less';
|
||||
const Welcome = React.memo(({ prefix, getUserData, config, ...restProps }) => {
|
||||
const currentPrefix = getPrefix(prefix);
|
||||
return (
|
||||
<div className={`${currentPrefix}-welcome`}>
|
||||
<div className={!!new URLSearchParams(window.location.search) ? '' : `${currentPrefix}-welcome`}>
|
||||
{
|
||||
<ConfigContent.Provider value={config}>
|
||||
<Home config={config} {...restProps} />
|
||||
|
Loading…
x
Reference in New Issue
Block a user