Skip to content

Commit d3da9a7

Browse files
committed
ci(release): web SPA 构建注入 VITE_FLUXCLOUD_BASE_URL 云服务地址
1 parent bdf362e commit d3da9a7

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,6 +1189,8 @@ jobs:
11891189
- name: Build web SPA
11901190
working-directory: web
11911191
run: bun run build
1192+
env:
1193+
VITE_FLUXCLOUD_BASE_URL: ${{ secrets.FLUXCLOUD_BASE_URL }}
11921194

11931195
- name: Upload webroot artifact
11941196
uses: actions/upload-artifact@v4

web/src/lib/cloud/client.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ import { applyCloudSession, clearCloudSession, cloudDefaultDeviceName, cloudDevi
77
import type { AuthResponse, CloudDevice, CloudProfile, DevicesResponse, LoginResult, TtlResponse } from './types'
88
import { CloudApiError } from './types'
99

10-
/** 开发期默认服务地址;FluxCloud 正式上线后这里切换为官方地址常量。 */
11-
const DEFAULT_BASE_URL = 'http://127.0.0.1:8720'
10+
/** 默认服务地址:Actions 打包时经 VITE_FLUXCLOUD_BASE_URL 构建期注入官方地址,
11+
* 未注入(本地开发)回退本地联调端口,与桌面端 FLUXCLOUD_BASE_URL dart-define 对称。 */
12+
const DEFAULT_BASE_URL: string = import.meta.env.VITE_FLUXCLOUD_BASE_URL?.trim() || 'http://127.0.0.1:8720'
1213
const BASE_KEY = 'fluxdown.cloud.base'
1314
const API_PREFIX = '/api/v1'
1415

0 commit comments

Comments
 (0)