From 1b57ebf7bee264c9f39951831a79137e8f20545d Mon Sep 17 00:00:00 2001 From: G Date: Tue, 2 Jan 2024 18:39:16 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20:sparkles:=20=E4=BF=AE=E6=94=B9VITE?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Readme.md | 8 ++++++++ apps/admin/.env.development | 6 +++++- apps/admin/.env.production | 4 +++- apps/admin/src/App.tsx | 6 +++--- apps/admin/src/layout/index.tsx | 5 +---- apps/admin/vite.config.ts | 4 ++-- 6 files changed, 22 insertions(+), 11 deletions(-) diff --git a/Readme.md b/Readme.md index 3aece1c6..6d6a83f2 100644 --- a/Readme.md +++ b/Readme.md @@ -69,3 +69,11 @@ antd5已经发布很久了,之前一直在维护的一套基于antd4版本的 ```bash npx @chenshuai2144/less2cssinjs less2js -i src ``` + +## + + + + + +欢迎 PR,您可以直接找我讨论,QQ: 1003473088,如果这是一个很大的变化! diff --git a/apps/admin/.env.development b/apps/admin/.env.development index 8fb7b2e4..9452b241 100644 --- a/apps/admin/.env.development +++ b/apps/admin/.env.development @@ -1 +1,5 @@ -VITE_APP_BASE_API: \ No newline at end of file +VITE_APP_BASE_API: + +VITE_APP_BASE_URL: './' + +VITE_PORT: 3100 \ No newline at end of file diff --git a/apps/admin/.env.production b/apps/admin/.env.production index 1c407f5d..d4232508 100644 --- a/apps/admin/.env.production +++ b/apps/admin/.env.production @@ -1 +1,3 @@ -VITE_APP_BASE_API: \ No newline at end of file +VITE_APP_BASE_API: + +VITE_APP_BASE_URL: '/react-antd-admin-pnpm/' \ No newline at end of file diff --git a/apps/admin/src/App.tsx b/apps/admin/src/App.tsx index 89fdaf62..b0996062 100644 --- a/apps/admin/src/App.tsx +++ b/apps/admin/src/App.tsx @@ -49,14 +49,14 @@ function App() { }} > - {/* {loading ? : } */} - {loading ? ( + {loading ? : } + {/* {loading ? ( ) : ( - )} + )} */} ); diff --git a/apps/admin/src/layout/index.tsx b/apps/admin/src/layout/index.tsx index 6a195bbe..ed302df8 100644 --- a/apps/admin/src/layout/index.tsx +++ b/apps/admin/src/layout/index.tsx @@ -1,6 +1,5 @@ import { Layout } from 'antd'; import ErrorBoundary from 'antd/es/alert/ErrorBoundary'; -import { Suspense } from 'react'; import { Outlet } from 'react-router-dom'; import { AppLogo } from '@/components/AppLogo'; @@ -30,9 +29,7 @@ export const BasicLayout = (props: any) => { - - - + diff --git a/apps/admin/vite.config.ts b/apps/admin/vite.config.ts index 60c6589c..351ac23b 100644 --- a/apps/admin/vite.config.ts +++ b/apps/admin/vite.config.ts @@ -21,10 +21,10 @@ export default ({ command, mode }: ConfigEnv): UserConfig => { // this function can be converted to different typings const viteEnv: any = wrapperEnv(env); - const { VITE_PORT, VITE_DROP_CONSOLE } = viteEnv; + const { VITE_PORT, VITE_DROP_CONSOLE, VITE_APP_BASE_URL } = viteEnv; return { - base: isBuild ? '/react-antd-admin-pnpm/' : './', + base: VITE_APP_BASE_URL, server: { // Listening on all local ips host: true,