签入版本
This commit is contained in:
@@ -34,13 +34,13 @@ VITE_GLOB_API_URL =
|
||||
VITE_GLOB_API_URL_PREFIX = /api
|
||||
|
||||
# 代理配置(JSON 数组格式:[["前缀","目标地址"]])
|
||||
VITE_PROXY = [["/api","http://admin.thinkphp6.elevue/api"]]
|
||||
VITE_PROXY = [["/api","http://admin.thinkphp8.elevue/api"]]
|
||||
|
||||
# 上传接口地址
|
||||
VITE_GLOB_UPLOAD_URL = /api/upload
|
||||
|
||||
# 图片访问地址(用于预览上传的图片)
|
||||
VITE_GLOB_IMG_URL = http://file.thinkphp6.elevue
|
||||
VITE_GLOB_IMG_URL = http://file.thinkphp8.elevue
|
||||
|
||||
# 是否在生产环境删除 console(开发环境保留)
|
||||
VITE_DROP_CONSOLE = false
|
||||
@@ -118,7 +118,7 @@ VITE_GLOB_API_URL =
|
||||
### VITE_PROXY — 开发代理配置
|
||||
|
||||
```bash
|
||||
VITE_PROXY = [["/api","http://admin.thinkphp6.elevue/api"]]
|
||||
VITE_PROXY = [["/api","http://admin.thinkphp8.elevue/api"]]
|
||||
```
|
||||
|
||||
**格式:** JSON 数组,每项为 `[前缀, 目标地址]`
|
||||
@@ -151,7 +151,7 @@ VITE_GLOB_UPLOAD_URL = /api/upload
|
||||
|
||||
```bash
|
||||
# 开发环境
|
||||
VITE_GLOB_IMG_URL = http://file.thinkphp6.elevue
|
||||
VITE_GLOB_IMG_URL = http://file.thinkphp8.elevue
|
||||
|
||||
# 生产环境
|
||||
VITE_GLOB_IMG_URL = https://cdn.example.com
|
||||
@@ -211,7 +211,7 @@ export default defineConfig(({ mode }) => {
|
||||
port: Number(env.VITE_PORT) || 8001,
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'http://admin.thinkphp6.elevue/api',
|
||||
target: 'http://admin.thinkphp8.elevue/api',
|
||||
changeOrigin: true,
|
||||
},
|
||||
},
|
||||
@@ -242,7 +242,7 @@ export default defineConfig(({ mode }) => {
|
||||
server: {
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'http://admin.thinkphp6.elevue/api', // 目标地址
|
||||
target: 'http://admin.thinkphp8.elevue/api', // 目标地址
|
||||
changeOrigin: true, // 修改请求头 Origin
|
||||
rewrite: (path) => path.replace(/^\/api/, ''), // 路径重写(可选)
|
||||
},
|
||||
@@ -257,7 +257,7 @@ server: {
|
||||
│
|
||||
▼ Vite proxy
|
||||
│
|
||||
▼ 转发到: http://admin.thinkphp6.elevue/api/user/page
|
||||
▼ 转发到: http://admin.thinkphp8.elevue/api/user/page
|
||||
```
|
||||
|
||||
## 构建命令
|
||||
@@ -342,7 +342,7 @@ server {
|
||||
# .env.staging
|
||||
VITE_GLOB_API_URL =
|
||||
VITE_GLOB_API_URL_PREFIX = /api
|
||||
VITE_GLOB_IMG_URL = https://test-cdn.example.com
|
||||
VITE_GLOB_IMG_URL = http://file.thinkphp8.elevue
|
||||
VITE_DROP_CONSOLE = true
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user