From bef37b4fd3ab9904a690613291324d6b76fba834 Mon Sep 17 00:00:00 2001 From: brian Date: Wed, 12 Jul 2023 10:14:44 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/defaultSettings.ts | 1 + src/app.tsx | 10 ++++++++-- src/pages/User/Login/index.tsx | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/config/defaultSettings.ts b/config/defaultSettings.ts index 4a3c41a..1b8fec3 100644 --- a/config/defaultSettings.ts +++ b/config/defaultSettings.ts @@ -14,6 +14,7 @@ const Settings: ProLayoutProps & { contentWidth: 'Fluid', fixedHeader: false, fixSiderbar: true, + splitMenus: false, colorWeak: false, title: 'Ans智能BI', pwa: true, diff --git a/src/app.tsx b/src/app.tsx index b9d2b6e..d16c2dc 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -1,9 +1,11 @@ import Footer from '@/components/Footer'; import { Question } from '@/components/RightContent'; import { LinkOutlined } from '@ant-design/icons'; +import type { Settings as LayoutSettings } from '@ant-design/pro-components'; import { SettingDrawer } from '@ant-design/pro-components'; import type { RunTimeLayoutConfig } from '@umijs/max'; import { history, Link } from '@umijs/max'; +import defaultSettings from '../config/defaultSettings'; import { AvatarDropdown, AvatarName } from './components/RightContent/AvatarDropdown'; import { errorConfig } from './requestConfig'; import { getLoginUserUsingGET } from './services/answerbi/userController'; @@ -14,6 +16,7 @@ const loginPath = '/user/login'; * @see https://umijs.org/zh-CN/plugins/plugin-initial-state * */ export async function getInitialState(): Promise<{ + settings?: Partial; currentUser?: API.LoginUserVO; }> { const fetchUserInfo = async () => { @@ -31,9 +34,12 @@ export async function getInitialState(): Promise<{ const currentUser = await fetchUserInfo(); return { currentUser, + settings: defaultSettings as Partial, }; } - return {}; + return { + settings: defaultSettings as Partial, + }; } // ProLayout 支持的api https://procomponents.ant.design/components/layout @@ -48,7 +54,7 @@ export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState }) = }, }, waterMarkProps: { - content: initialState?.currentUser?.name, + content: initialState?.currentUser?.userName, }, footerRender: () =>