feat(mining-admin-web): 配置生产环境API指向Kong网关
修改: 1. frontend/mining-admin-web/src/lib/api/client.ts - 使用环境变量 NEXT_PUBLIC_API_URL 配置 API baseURL - 开发环境默认使用 /api 代理 2. frontend/mining-admin-web/.env.production (新增) - NEXT_PUBLIC_API_URL=https://rwaapi.szaiai.com/api/v2/mining-admin 3. backend/api-gateway/kong.yml - CORS origins 添加 https://madmin.szaiai.com - CORS origins 添加 http://localhost:3100 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
42e6b5c27c
commit
341e319fd3
|
|
@ -374,10 +374,12 @@ plugins:
|
||||||
config:
|
config:
|
||||||
origins:
|
origins:
|
||||||
- "https://rwaadmin.szaiai.com"
|
- "https://rwaadmin.szaiai.com"
|
||||||
|
- "https://madmin.szaiai.com"
|
||||||
- "https://update.szaiai.com"
|
- "https://update.szaiai.com"
|
||||||
- "https://app.rwadurian.com"
|
- "https://app.rwadurian.com"
|
||||||
- "http://localhost:3000"
|
- "http://localhost:3000"
|
||||||
- "http://localhost:3020"
|
- "http://localhost:3020"
|
||||||
|
- "http://localhost:3100"
|
||||||
methods:
|
methods:
|
||||||
- GET
|
- GET
|
||||||
- POST
|
- POST
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
NEXT_PUBLIC_API_URL=https://rwaapi.szaiai.com/api/v2/mining-admin
|
||||||
|
NEXT_PUBLIC_APP_NAME=挖矿管理后台
|
||||||
|
|
@ -1,7 +1,10 @@
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
||||||
|
// 生产环境使用 NEXT_PUBLIC_API_URL,开发环境使用 /api 代理
|
||||||
|
const baseURL = process.env.NEXT_PUBLIC_API_URL || '/api';
|
||||||
|
|
||||||
export const apiClient = axios.create({
|
export const apiClient = axios.create({
|
||||||
baseURL: '/api',
|
baseURL,
|
||||||
timeout: 30000,
|
timeout: 30000,
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue