前端重构

This commit is contained in:
Yvan 2026-01-07 20:00:51 +08:00
parent 3bdf684eae
commit 2eb9ccfff8
4 changed files with 38 additions and 112 deletions

View File

@ -24,12 +24,6 @@ export default defineConfig({
*/ */
hash: true, hash: true,
/**
* @name esbuild minify IIFE
* @description esbuild helpers
*/
esbuildMinifyIIFE: true,
publicPath: PUBLIC_PATH, publicPath: PUBLIC_PATH,
/** /**
@ -89,7 +83,7 @@ export default defineConfig({
* @name layout * @name layout
* @doc https://umijs.org/docs/max/layout-menu * @doc https://umijs.org/docs/max/layout-menu
*/ */
title: "KRA Admin", title: "Ant Design Pro",
layout: { layout: {
locale: true, locale: true,
...defaultSettings, ...defaultSettings,
@ -174,6 +168,7 @@ export default defineConfig({
mock: { mock: {
include: ["mock/**/*", "src/pages/**/_mock.ts"], include: ["mock/**/*", "src/pages/**/_mock.ts"],
}, },
utoopack: {},
requestRecord: {}, requestRecord: {},
exportStatic: {}, exportStatic: {},
define: { define: {

View File

@ -1,47 +1,27 @@
import type { ProLayoutProps } from '@ant-design/pro-components'; import type { ProLayoutProps } from '@ant-design/pro-components';
/** /**
* @name KRA * @name
* @description GVA Ant Design Pro
*/ */
const Settings: ProLayoutProps & { const Settings: ProLayoutProps & {
pwa?: boolean; pwa?: boolean;
logo?: string; logo?: string;
showWatermark?: boolean;
} = { } = {
navTheme: 'light', navTheme: 'light',
// 主题色 - 与 GVA 保持一致的蓝色 // 拂晓蓝
colorPrimary: '#3b82f6', colorPrimary: '#1890ff',
// 布局模式: side | top | mix
layout: 'mix', layout: 'mix',
contentWidth: 'Fluid', contentWidth: 'Fluid',
// 固定头部 fixedHeader: false,
fixedHeader: true,
// 固定侧边栏
fixSiderbar: true, fixSiderbar: true,
// 色弱模式
colorWeak: false, colorWeak: false,
// 应用标题 title: 'Ant Design Pro',
title: 'KRA Admin',
pwa: true, pwa: true,
// Logo logo: 'https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg',
logo: '/logo.svg',
iconfontUrl: '', iconfontUrl: '',
// 显示水印
showWatermark: true,
// 侧边栏宽度配置
siderWidth: 256,
token: { token: {
// 头部高度 // 参见ts声明demo 见文档通过token 修改样式
header: { //https://procomponents.ant.design/components/layout#%E9%80%9A%E8%BF%87-token-%E4%BF%AE%E6%94%B9%E6%A0%B7%E5%BC%8F
heightLayoutHeader: 64,
},
// 侧边栏配置
sider: {
colorMenuBackground: '#fff',
colorTextMenuSelected: '#3b82f6',
colorBgMenuItemSelected: '#e6f4ff',
},
}, },
}; };

View File

@ -15,10 +15,9 @@ export default {
* @doc https://github.com/chimurai/http-proxy-middleware * @doc https://github.com/chimurai/http-proxy-middleware
*/ */
dev: { dev: {
"/api/": { "/v1/": {
target: "http://localhost:8000", target: "http://localhost:8000",
changeOrigin: true, changeOrigin: true,
pathRewrite: { "^/api": "" }, },
}
}, },
}; };

View File

@ -1,95 +1,47 @@
/** /**
* @name umi * @name umi
* @description GVA * @description path,component,routes,redirect,wrappers,name,icon
* @param path path 第一种是动态参数 :id *
* @param component location path React src/pages
* @param routes layout 使
* @param redirect
* @param wrappers
* @param name menu.ts menu.xxxx name login menu.ts menu.login
* @param icon https://ant.design/components/icon-cn 注意去除风格后缀和大小写,如想要配置图标为 <StepBackwardOutlined /> 则取值应为 stepBackward 或 StepBackward如想要配置图标为 <UserOutlined /> 则取值应为 user 或者 User
* @doc https://umijs.org/docs/guides/routes
*/ */
export default [ export default [
{ {
path: '/user', path: "/user",
layout: false, layout: false,
routes: [ routes: [
{ {
name: 'login', name: "login",
path: '/user/login', path: "/user/login",
component: './user/login', component: "./user/login",
}, },
], ],
}, },
{ {
path: '/dashboard', path: "/welcome",
name: 'dashboard', name: "welcome",
icon: 'dashboard', icon: "smile",
component: './dashboard', component: "./Welcome",
}, },
{ {
path: '/system', name: "admin",
name: 'system', icon: "crown",
icon: 'setting', path: "/admins",
access: 'canAdmin', access: "canAdmin",
routes: [ component: "./admins",
{
path: '/system/user',
name: 'user',
icon: 'user',
component: './system/user',
},
{
path: '/system/authority',
name: 'authority',
icon: 'team',
component: './system/authority',
},
{
path: '/system/menu',
name: 'menu',
icon: 'menu',
component: './system/menu',
},
{
path: '/system/api',
name: 'api',
icon: 'api',
component: './system/api',
},
{
path: '/system/dictionary',
name: 'dictionary',
icon: 'book',
component: './system/dictionary',
},
{
path: '/system/operation',
name: 'operation',
icon: 'fileSearch',
component: './system/operation',
},
{
path: '/system/params',
name: 'params',
icon: 'control',
component: './system/params',
},
{
path: '/system/state',
name: 'state',
icon: 'monitor',
component: './system/state',
},
],
}, },
{ {
path: '/person', path: "/",
name: 'person', redirect: "/welcome",
icon: 'idcard',
component: './person',
hideInMenu: true,
}, },
{ {
path: '/', component: "404",
redirect: '/dashboard',
},
{
path: '*',
layout: false, layout: false,
component: './404', path: "./*",
}, },
]; ];