前端重构

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

View File

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

View File

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

View File

@ -1,95 +1,47 @@
/**
* @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 [
{
path: '/user',
path: "/user",
layout: false,
routes: [
{
name: 'login',
path: '/user/login',
component: './user/login',
name: "login",
path: "/user/login",
component: "./user/login",
},
],
},
{
path: '/dashboard',
name: 'dashboard',
icon: 'dashboard',
component: './dashboard',
path: "/welcome",
name: "welcome",
icon: "smile",
component: "./Welcome",
},
{
path: '/system',
name: 'system',
icon: 'setting',
access: 'canAdmin',
routes: [
{
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',
},
],
name: "admin",
icon: "crown",
path: "/admins",
access: "canAdmin",
component: "./admins",
},
{
path: '/person',
name: 'person',
icon: 'idcard',
component: './person',
hideInMenu: true,
path: "/",
redirect: "/welcome",
},
{
path: '/',
redirect: '/dashboard',
},
{
path: '*',
component: "404",
layout: false,
component: './404',
path: "./*",
},
];