#
luxiaotao1123
2024-02-25 7bc7a9c11f4ed9b8539e9c72e5a09effcedf317a
zy-asrs-flow/src/App.jsx
@@ -1,5 +1,5 @@
import React from 'react';
import { Footer, Question, SelectLang, AvatarDropdown, AvatarName } from '@/components';
import { Footer, Question, SelectLang, AvatarDropdown, AvatarName, Brightness } from '@/components';
import { LinkOutlined } from '@ant-design/icons';
import { SettingDrawer } from '@ant-design/pro-components';
import { history, Link } from '@umijs/max';
@@ -82,7 +82,7 @@
// 优先级 layout > config > defaultSetting
export const layout = ({ initialState, setInitialState }) => {
  return {
    actionsRender: () => [<Question key="doc" />, <SelectLang key="SelectLang" />],
    actionsRender: () => [<Brightness />, <Question key="doc" />, <SelectLang key="SelectLang" />],
    avatarProps: {
      src: initialState?.currentUser?.avatar,
      title: <AvatarName />,
@@ -144,15 +144,7 @@
      },
    ],
    // 显示在菜单右下角的快捷操作
    links: false
      // links: isDev
      ? [
        <Link key="openapi" to="/umi/plugin/openapi" target="_blank">
          <LinkOutlined />
          <span>OpenAPI 文档</span>
        </Link>,
      ]
      : [],
    links: [],
    menuHeaderRender: undefined,
    // 自定义 403 页面
    // unAccessible: <div>unAccessible</div>,
@@ -180,7 +172,7 @@
      );
    },
    ...initialState?.settings,
    layout: 'top',  // layout 的菜单模式,side:右侧导航,top:顶部导航
    layout: 'mix',  // layout 的菜单模式,side:右侧导航,top:顶部导航
    // contentStyle: () => {  //    layout 的内容区 style
    //   return 
    // },
@@ -188,7 +180,7 @@
    fixedHeader: true,  // 固定 header
    fixSiderbar: true,  // 固定导航
    // settings: defaultSettings, // layout 的设置
    waterMarkProps: { content: initialState?.currentUser?.nickname }, //水印
    // waterMarkProps: { content: initialState?.currentUser?.nickname }, //水印
    navTheme: 'realDark', // 默认主题颜色  "realDark" | "light" | undef...
    footerRender: false,  // 页脚 启用请注释,不是设置为true
  };