From 6d3507890043a0d062a2a4f65d75964731c680fb Mon Sep 17 00:00:00 2001 From: kangod Date: Mon, 5 Feb 2024 17:52:02 +0800 Subject: [PATCH] =?UTF-8?q?config:=20=E5=8E=BB=E6=8E=89=20msw=20=E7=9A=84?= =?UTF-8?q?=E8=B0=83=E7=94=A8=EF=BC=9B=E4=BF=AE=E6=94=B9=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=90=AF=E5=8A=A8=E7=AB=AF=E5=8F=A3=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LICENSE | 21 --------------------- src/main.tsx | 5 ++--- vite.config.ts | 6 ++---- 3 files changed, 4 insertions(+), 28 deletions(-) delete mode 100644 LICENSE diff --git a/LICENSE b/LICENSE deleted file mode 100644 index ceb73cc..0000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2023 d3george - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/src/main.tsx b/src/main.tsx index 897b089..c214e05 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -11,7 +11,6 @@ import 'virtual:svg-icons-register'; import App from '@/App'; -import { worker } from './_mock'; // i18n import './locales/i18n'; // tailwind css @@ -54,5 +53,5 @@ root.render( , ); -// 🥵 start service worker mock in development mode -worker.start({ onUnhandledRequest: 'bypass' }); +// 不再使用 mock 数据,调用 nest 后端获取 +// worker.start({ onUnhandledRequest: 'bypass' }); diff --git a/vite.config.ts b/vite.config.ts index 35e0a71..51ac2ec 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -31,13 +31,11 @@ export default defineConfig({ }), ], server: { - // 自动打开浏览器 - open: true, host: true, - port: 3001, + port: 7442, proxy: { '/api': { - target: 'http://localhost:3000', + target: 'http://127.0.0.1:7441', changeOrigin: true, rewrite: (path) => path.replace(/^\/api/, ''), },