Skip to content

Commit 7fa5ad9

Browse files
committed
feat: code optimization (#17)
* chore: update dir * chore: Optimize dependencies * fix: fix type
1 parent 715177c commit 7fa5ad9

File tree

7 files changed

+7
-15
lines changed

7 files changed

+7
-15
lines changed

eslint.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export default antfu({
1919
},
2020
},
2121
rules: {
22+
"no-console": "warn",
2223
"ts/no-namespace": 0,
2324
"ts/no-unsafe-call": 0,
2425
"ts/no-unsafe-return": 0,

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
"dependencies": {
2424
"@ant-design/icons": "^5.3.4",
2525
"@babel/runtime": "^7.24.0",
26-
"@unocss/reset": "^0.53.6",
2726
"antd": "^5.15.3",
2827
"axios": "^1.6.8",
2928
"classnames": "^2.5.1",

src/assets/css/init.css

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
@import "@unocss/reset/normalize.css";
2-
31
@tailwind base;
42
@tailwind components;
53
@tailwind utilities;

src/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ interface PathRoute {
66
icon?: any;
77
notMenu?: boolean;
88
redirect?: string;
9-
component?: React.LazyExoticComponent;
9+
component?: string;
1010
childrenList?: Route[];
1111
}
1212
interface IndexRoute {
@@ -17,7 +17,7 @@ interface IndexRoute {
1717
icon?: any;
1818
notMenu?: boolean;
1919
redirect?: string;
20-
component?: React.LazyExoticComponent;
20+
component?: string;
2121
childrenList?: Route[];
2222
}
2323
type Route = PathRoute | IndexRoute;

src/router/config.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,13 @@ const GLOBAL_ROUTERS = {
3535
LOGIN_PAGE: {
3636
path: "/login",
3737
title: "登录",
38-
component: "/login/index",
38+
component: "/login",
3939
} as Route,
40-
4140
// 动态路由页面
4241
APP_PAGE: [
4342
{
4443
path: "/",
45-
component: "/system/index",
44+
component: "/index",
4645
childrenList: [
4746
{
4847
title: "首页",
@@ -106,12 +105,11 @@ const GLOBAL_ROUTERS = {
106105
],
107106
},
108107
] as Route[],
109-
110108
// 404
111109
NOT_FOUND_PAGE: {
112110
path: "*",
113111
redirect: "/login",
114-
} as Route,
112+
} as Route
115113
};
116114

117115
/**
@@ -131,7 +129,7 @@ export function transformRouter(routers: Route[]) {
131129

132130
// 多级嵌套 补全 /
133131
if (path?.startsWith("/") && childrenList?.length) {
134-
newPath = (`${path}/`).replace(/\/{2,}/g, "/");
132+
newPath = `${path}/`.replace(/\/{2,}/g, "/");
135133
}
136134

137135
const routeObj: Route = {

tailwind.config.cjs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,4 @@ module.exports = {
1515
},
1616
},
1717
plugins: [],
18-
corePlugins: {
19-
preflight: false,
20-
},
21-
important: true,
2218
};

0 commit comments

Comments
 (0)