diff --git a/db.json b/db.json deleted file mode 100644 index c2335a6..0000000 --- a/db.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "users": [ - { - "id": 1, - "username": "test", - "password": "test", - "token": "123456" - } - ] -} \ No newline at end of file diff --git a/package.json b/package.json index 0843240..5082259 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "scripts": { "dev": "vite", "build": "vite build", + "serve": "vite serve", "preview": "vite preview", "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs --fix --ignore-path .gitignore", "format": "prettier --write src/" diff --git a/src/components/CustomLogin.vue b/src/components/CustomLogin.vue index 6c35da8..45b8051 100644 --- a/src/components/CustomLogin.vue +++ b/src/components/CustomLogin.vue @@ -1,6 +1,7 @@ diff --git a/vite.config.js b/vite.config.js index 26a21a9..d114b5b 100644 --- a/vite.config.js +++ b/vite.config.js @@ -14,5 +14,10 @@ export default defineConfig({ alias: { '@': fileURLToPath(new URL('./src', import.meta.url)) } + }, + server: { + proxy: { + '/api': 'http://localhost:3000', // 代理 API 请求 + } } })