Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
R
river-refunds
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Qian Xu
river-refunds
Commits
63922f77
Commit
63922f77
authored
Jul 15, 2026
by
Nicholas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
1415ef0a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
20 deletions
+13
-20
README.md
README.md
+13
-20
No files found.
README.md
View file @
63922f77
...
...
@@ -11,17 +11,19 @@ npm run dev
访问:
`http://localhost:5173/?id=PASSENGER_ID`
连接测试环境:
本地开发时 Vite 会把
`/api2`
代理到测试中台(
`https://viking-test.streams7.com`
),所以本地默认连测试环境,无需额外配置。
```
bash
npm run dev:staging
```
## 环境区分
连接生产环境
:
**同一份构建产物,测试和生产通用**
,运行时按访问域名自动区分,不依赖构建参数或
`.env`
文件
:
```
bash
npm run dev:production
```
| 访问域名 | streams 中台 | message 服务 |
| --- | --- | --- |
|
`streams.vikingcruises.cn`
(生产) |
`https://streams.vikingcruises.cn/api/`
|
`https://api.vikingcruises.cn/message`
|
| 其它域名 / 测试 |
`https://viking-test.streams7.com/api/`
|
`https://api-staging.cmviking.com/message`
|
| 本地
`localhost`
(dev) |
`/api2`
代理 → 测试中台 | 测试 message |
判断逻辑见
`src/streamsRequest.js`
与
`src/api.js`
(
`window.location.hostname`
是否属于生产域名列表)。若生产域名有变动,只需修改这两个文件里的
`PROD_HOSTS`
。
## 接口配置
...
...
@@ -49,21 +51,12 @@ npm run dev:production
}
```
本地开发时 Vite 会把
`/api2`
代理到测试中台;生产环境默认使用
`https://streams.vikingcruises.cn/api/`
。
## 打包部署
应用按
`/river-refunds/`
子路径打包
,静态资源和 manifest 都会使用这个 base
。
应用按
`/river-refunds/`
子路径打包
(生产构建时生效),静态资源和 manifest 都使用这个 base;本地 dev 则用
`/`
。
```
bash
npm run build:staging
npm run build:production
npm run build
```
产物目录:
`dist/`
默认不走 mock 数据。只有需要本地演示交互时,才设置:
```
bash
VITE_USE_MOCK
=
true
```
产物目录:
`dist/`
。构建一次即可部署到测试和生产两套环境,无需分别打包。
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment