packServer/miniprogram/vite.config.ts
liufumingren 8f1a8b7ddb feat(miniprogram): 新增 uni-app + Vue3 + TS 微信小程序
- 登录:微信一键登录(code2Session)+ 账号登录双 tab;个人中心为整页登录,其它页走抽屉
- 协议:登录前必须阅读并同意,版本号随登录上报落库
- 不强制登录:启动不弹窗,点功能或遇到 401 才提示(符合小程序审核)
- 页面:首页统计 / 扫码记录 / 个人中心;H5 预览端口 7304

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-21 00:47:16 +08:00

17 lines
536 B
TypeScript
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.

import { defineConfig } from 'vite';
import uni from '@dcloudio/vite-plugin-uni';
/**
* 小程序 H5 预览(7304):**不代理 /api**,接口直连后端绝对地址(见 `src/api/client.ts`,
* 后端已开 CORS)。`VITE_BACKEND` 只在需要时用来对齐默认地址,不再参与转发。
*/
export default defineConfig({
plugins: [uni()],
server: {
// 本项目端口约定:前端 7301/7302、后端 7300,小程序 H5 预览用 7304
host: '127.0.0.1',
port: 7304,
strictPort: true,
},
});