feat(frontend): update portal layout and API environments

This commit is contained in:
david
2026-07-31 16:26:54 +08:00
parent 7e0cd360e9
commit 88c61b9be4
65 changed files with 434 additions and 8589 deletions

View File

@@ -1,3 +1,4 @@
VITE_API_BASE_URL=http://localhost:12426/heqi/delivery/v1
# 可选覆盖;开发默认 http://localhost:12426/heqi/delivery/v1,生产构建默认 http://rest.heqiapp.com/heqi/delivery/v1。
VITE_API_BASE_URL=
# 受保护 API 使用 BSM JWT本地联调时由认证服务签发不要提交真实令牌。
VITE_DEV_JWT=

View File

@@ -1,6 +1,6 @@
# 和气配送点管理系统
配送点管理端使用 Vue 3、TypeScript、Vite、Pinia 和 Arco Design开发端口为 `5176`默认 API 为 `http://localhost:12426/heqi/delivery/v1`
配送点管理端使用 Vue 3、TypeScript、Vite、Pinia 和 Arco Design开发端口为 `5176`。开发默认 API 为 `http://localhost:12426/heqi/delivery/v1`,生产构建默认 API 为 `http://rest.heqiapp.com/heqi/delivery/v1`
```bash
pnpm install

View File

@@ -5,7 +5,7 @@ import { resolve } from 'path';
import visualizer from 'rollup-plugin-visualizer';
import { ArcoResolver } from 'unplugin-vue-components/resolvers';
import Components from 'unplugin-vue-components/vite';
import { defineConfig, type PluginOption } from 'vite';
import { defineConfig, loadEnv, type PluginOption } from 'vite';
import compressPlugin from 'vite-plugin-compression';
import svgLoader from 'vite-svg-loader';
@@ -29,6 +29,10 @@ function manualChunks(id: string) {
export default defineConfig(({ command, mode }) => {
const isDev = command === 'serve';
const isReport = mode === 'report';
const env = loadEnv(mode, process.cwd(), '');
const apiBaseURL =
env.VITE_API_BASE_URL ||
`${isDev ? 'http://localhost:12426' : 'http://rest.heqiapp.com'}/heqi/delivery/v1`;
const plugins: PluginOption[] = [
vue(),
@@ -60,6 +64,9 @@ export default defineConfig(({ command, mode }) => {
}
return {
define: {
'import.meta.env.VITE_API_BASE_URL': JSON.stringify(apiBaseURL),
},
plugins,
resolve: {
alias: [