fix(frontend): use HTTPS for production API
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# 可选覆盖;开发默认 http://localhost:12426/heqi/platform/v1,生产构建默认 http://rest.heqiapp.com/heqi/platform/v1。
|
||||
# 可选覆盖;开发默认 http://localhost:12426/heqi/platform/v1,生产构建默认 https://rest.heqiapp.com/heqi/platform/v1。
|
||||
VITE_API_BASE_URL=
|
||||
# 受保护 API 使用 BSM JWT;本地联调时由认证服务签发,不要提交真实令牌。
|
||||
VITE_DEV_JWT=
|
||||
|
||||
@@ -36,5 +36,5 @@ pnpm build
|
||||
|
||||
| 变量 | 说明 |
|
||||
| --- | --- |
|
||||
| `VITE_API_BASE_URL` | 可选覆盖后端 API 地址;开发默认 `http://localhost:12426/heqi/platform/v1`,生产构建默认 `http://rest.heqiapp.com/heqi/platform/v1` |
|
||||
| `VITE_API_BASE_URL` | 可选覆盖后端 API 地址;开发默认 `http://localhost:12426/heqi/platform/v1`,生产构建默认 `https://rest.heqiapp.com/heqi/platform/v1` |
|
||||
| `VITE_ERROR_REPORT_URL` | 可选的前端错误上报地址 |
|
||||
|
||||
@@ -32,7 +32,7 @@ export default defineConfig(({ command, mode }) => {
|
||||
const env = loadEnv(mode, process.cwd(), '');
|
||||
const apiBaseURL =
|
||||
env.VITE_API_BASE_URL ||
|
||||
`${isDev ? 'http://localhost:12426' : 'http://rest.heqiapp.com'}/heqi/platform/v1`;
|
||||
`${isDev ? 'http://localhost:12426' : 'https://rest.heqiapp.com'}/heqi/platform/v1`;
|
||||
|
||||
const plugins: PluginOption[] = [
|
||||
vue(),
|
||||
|
||||
Reference in New Issue
Block a user