docs: 更新环境配置文档说明(统一使用域名访问)
This commit is contained in:
+14
-11
@@ -95,33 +95,36 @@ pnpm build:h5
|
|||||||
|
|
||||||
项目使用 `.env` 文件管理环境变量:
|
项目使用 `.env` 文件管理环境变量:
|
||||||
|
|
||||||
| 文件 | 说明 | 用途 |
|
| 文件 | 说明 | API 地址 | WebSocket 地址 |
|
||||||
|------|------|------|
|
|------|------|----------|----------------|
|
||||||
| `.env.development` | 开发环境配置 | 本地开发调试,指向 localhost |
|
| `.env.development` | 开发环境配置 | https://lifescript.happylifeos.com/api | wss://lifescript.happylifeos.com/ws |
|
||||||
| `.env.test` | 测试环境配置 | 小程序体验版,指向服务器 API |
|
| `.env.test` | 测试环境配置 | https://lifescript.happylifeos.com/api | wss://lifescript.happylifeos.com/ws |
|
||||||
| `.env.production` | 生产环境配置 | 小程序正式版,指向服务器 API |
|
| `.env.production` | 生产环境配置 | https://lifescript.happylifeos.com/api | wss://lifescript.happylifeos.com/ws |
|
||||||
|
|
||||||
**开发环境配置**(`.env.development`):
|
**开发环境配置**(`.env.development`):
|
||||||
```bash
|
```bash
|
||||||
|
# 开发环境配置(本地开发调试)
|
||||||
VITE_APP_ENV=dev
|
VITE_APP_ENV=dev
|
||||||
VITE_API_BASE_URL=http://localhost:19089/api
|
VITE_API_BASE_URL=https://lifescript.happylifeos.com/api
|
||||||
VITE_WS_URL=ws://localhost:19089
|
VITE_WS_URL=wss://lifescript.happylifeos.com/ws
|
||||||
VITE_DEBUG=true
|
VITE_DEBUG=true
|
||||||
```
|
```
|
||||||
|
|
||||||
**测试环境配置**(`.env.test`):
|
**测试环境配置**(`.env.test`):
|
||||||
```bash
|
```bash
|
||||||
|
# 测试环境配置(小程序体验版)
|
||||||
VITE_APP_ENV=test
|
VITE_APP_ENV=test
|
||||||
VITE_API_BASE_URL=http://101.200.208.45:19089/api
|
VITE_API_BASE_URL=https://lifescript.happylifeos.com/api
|
||||||
VITE_WS_URL=ws://101.200.208.45:19089
|
VITE_WS_URL=wss://lifescript.happylifeos.com/ws
|
||||||
VITE_DEBUG=true
|
VITE_DEBUG=true
|
||||||
```
|
```
|
||||||
|
|
||||||
**生产环境配置**(`.env.production`):
|
**生产环境配置**(`.env.production`):
|
||||||
```bash
|
```bash
|
||||||
|
# 生产环境配置(小程序正式版)
|
||||||
VITE_APP_ENV=prod
|
VITE_APP_ENV=prod
|
||||||
VITE_API_BASE_URL=http://101.200.208.45:19089/api
|
VITE_API_BASE_URL=https://lifescript.happylifeos.com/api
|
||||||
VITE_WS_URL=ws://101.200.208.45:19089
|
VITE_WS_URL=wss://lifescript.happylifeos.com/ws
|
||||||
VITE_DEBUG=false
|
VITE_DEBUG=false
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user