- 生产 nginx 三路径: ry-vue3 /hg/, ry-h5 /camera/, API /hg-api, .env 分环境 - 签约链接/摄像头 base-url 走 yml, 不再硬编码 /hg 与 localhost - 新增 biz_project_executor_assign (镜像 sponsor_assign) 执行方项目级分配 - 会议费用后台汇总 FeeCalcScheduler + 结算回写项目金额 + 状态流转调度 - 签到表拍照高斯模糊脱敏 extra_oss_url, 新增 PosterService/StageDeriver - 清理 biz_support_intent 旧表 (6 Java/XML 删除) - ry-h5 相机黑屏修复: 显式 video.play() + 动态 apiBase 上传 - 资源: simhei 字体 / logo.png / qrcode_1.png / favicon.ico Co-Authored-By: Claude <noreply@anthropic.com>
40 lines
1.2 KiB
JavaScript
40 lines
1.2 KiB
JavaScript
import { defineConfig, loadEnv } from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
import AutoImport from 'unplugin-auto-import/vite'
|
|
import Components from 'unplugin-vue-components/vite'
|
|
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
|
|
import path from 'path'
|
|
|
|
export default defineConfig(({ mode }) => {
|
|
const env = loadEnv(mode, process.cwd(), '')
|
|
// 开发 API 前缀 = /dev-api (Vite dev proxy), 生产 = /hg-api (nginx 反代)
|
|
const apiPath = env.VITE_APP_BASE_API || '/dev-api'
|
|
return {
|
|
// 生产部署在 nginx /hg/ 子路径下 (.env.production 设 VITE_BASE=/hg/), 开发默认 /
|
|
base: env.VITE_BASE || '/',
|
|
plugins: [
|
|
vue(),
|
|
AutoImport({ resolvers: [ElementPlusResolver()] }),
|
|
Components({ resolvers: [ElementPlusResolver()] })
|
|
],
|
|
resolve: {
|
|
alias: { '@': path.resolve(__dirname, 'src') }
|
|
},
|
|
build: {
|
|
// 老浏览器兼容: 把 ?. / ?? / 箭头函数等 ES2020+ 语法降级到 es2015
|
|
target: 'es2015'
|
|
},
|
|
server: {
|
|
port: 5173,
|
|
host: '0.0.0.0',
|
|
proxy: {
|
|
[apiPath]: {
|
|
target: 'http://127.0.0.1:8080',
|
|
changeOrigin: true,
|
|
rewrite: (p) => p.replace(new RegExp('^' + apiPath), '')
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|