Files
FastapiAdmin/frontend/app/.env.development
T
zhangtao 007864051a fix(frontend): 修复 5 条 P0(生产构建开关、令牌刷新、上传路径、WS 与开发地址)
- web/vite.config.ts:生产判据由 `mode === "prod"`(恒 false)改为 `production || prod`,
  压缩/去 console/剔除 vue-devtools 插件真正生效;同时修正 terser `comments: true`
  (是「保留全部注释」,与注释文字相反)为 `"some"`,保留 @license 等版权声明
- app 刷新令牌:改为发送 JSON 字符串(后端为 Body(str)),与 web 端已知可用实现一致,
  修掉移动端 token 过期必然 422 强制登出
- app 上传:路径补 /common(真实路径 /api/v1/common/file/upload),并改走统一 http 层的
  wd-upload upload-method 钩子,Authorization 由 http 层注入,不再页面自拼 URL
- app 生产 WS:ws://localhost:5180/ws → wss://service.fastapiadmin.com;开发 WS 指向本机
- app 开发接口地址:改为 http://127.0.0.1:8001,与 web 端开发策略一致

复核证据(队长独立执行):web/app type-check 均 exit 0;build:prod 与 build:h5 均 exit 0;
生产包内第一方 console 特征串 9/9 全部 0 命中(剩余 5 处 console 为字符串文案或
第三方 typeof 守卫,非可执行调用);H5 产物内 localhost:5180 命中 0、wss 域名命中 1、
裸 /file/upload 命中 0、/common/file/upload 命中 1。
2026-10-04 04:33:42 +08:00

27 lines
871 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 开发环境变量
# 在开发模式下使用 (npm run dev)
# API 基础 URL - 开发环境
# 本机后端;与 web 端 frontend/web/.env.development 的 VITE_API_BASE_URL 策略保持一致。
# 需要联调线上环境时,改为 https://service.fastapiadmin.com(注意会直接读写生产数据)。
VITE_API_BASE_URL=http://127.0.0.1:8001
# 环境名称
VITE_ENV_NAME=development
# 项目名称
VITE_APP_TITLE=fastapiadmin
# 代理前缀
VITE_APP_BASE_API=/api/v1
# 应用端口(vite dev server 启动端口,对应 vite.config.ts 的 server.port,缺省 vite 默认 5173)
VITE_APP_PORT=5180
# 超时时间
VITE_TIMEOUT=10000
# WebSocket 服务器的 URL,不配置默认关闭 WebSocket
# 开发环境同样指向本机后端,避免 dev 构建连到生产 WS(只填基址,路径由代码拼接)
VITE_APP_WS_ENDPOINT=ws://127.0.0.1:8001