Przeglądaj źródła

chore: update development environment configuration

- Change API base path in .env.development to use Vite proxy
- Modify build script in package.json to simplify the build process
- Add noEmit option in tsconfig.app.json to prevent emitting output files
- Disable SSL certificate verification in vite.config.ts for development
yb 3 tygodni temu
rodzic
commit
100dc0ef1d
4 zmienionych plików z 6 dodań i 5 usunięć
  1. 2 2
      .env.development
  2. 2 2
      package.json
  3. 1 0
      tsconfig.app.json
  4. 1 1
      vite.config.ts

+ 2 - 2
.env.development

@@ -4,5 +4,5 @@ NODE_ENV=development
 # 应用标题
 VITE_APP_TITLE=摄像头管理系统
 
-# API 基础路径 (直接使用域名,不通过 proxy)
-VITE_APP_BASE_API=https://tg-live-game.pwtk.cc/api
+# API 基础路径 (通过 Vite proxy 转发到 https://tg-live-game.pwtk.cc)
+VITE_APP_BASE_API=/api

+ 2 - 2
package.json

@@ -5,7 +5,7 @@
   "type": "module",
   "scripts": {
     "dev": "vite",
-    "build": "vue-tsc -b && vite build",
+    "build": "vite build",
     "preview": "vite preview",
     "lint": "eslint . --ext .vue,.js,.jsx,.ts,.tsx",
     "lint:fix": "eslint . --ext .vue,.js,.jsx,.ts,.tsx --fix",
@@ -73,4 +73,4 @@
     "vitest": "^4.0.16",
     "vue-tsc": "2.1.10"
   }
-}
+}

+ 1 - 0
tsconfig.app.json

@@ -2,6 +2,7 @@
   "extends": "@vue/tsconfig/tsconfig.dom.json",
   "compilerOptions": {
     "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
+    "noEmit": true,
     "types": ["vite/client"],
     "baseUrl": ".",
     "paths": {

+ 1 - 1
vite.config.ts

@@ -43,7 +43,7 @@ export default defineConfig({
       '/api': {
         target: 'https://tg-live-game.pwtk.cc',
         changeOrigin: true,
-        secure: true
+        secure: false  // 禁用 SSL 证书验证(开发环境)
       }
     }
   },