feat(0.2.1): 同步端点支持 VITE_POWERSYNC_URL 覆写 (Tauri 外壳等打包端按需指定)
This commit is contained in:
@@ -8,7 +8,8 @@ export class IBoardConnector {
|
|||||||
// 未登录: 返回 null 让 SDK 保持断开 (登录后由页面触发 connect)
|
// 未登录: 返回 null 让 SDK 保持断开 (登录后由页面触发 connect)
|
||||||
if (!getToken()) return null
|
if (!getToken()) return null
|
||||||
const { token, endpoint } = await api('/powersync/token', { method: 'POST' })
|
const { token, endpoint } = await api('/powersync/token', { method: 'POST' })
|
||||||
return { endpoint: endpoint || '', token }
|
// VITE_POWERSYNC_URL: 打包端 (Tauri 外壳等) 可覆盖服务端下发的同步地址
|
||||||
|
return { endpoint: import.meta.env.VITE_POWERSYNC_URL || endpoint || '', token }
|
||||||
}
|
}
|
||||||
|
|
||||||
async invalidateCredentials() {
|
async invalidateCredentials() {
|
||||||
|
|||||||
Reference in New Issue
Block a user