chore: 客戶端自動添加 token 和 device_id 到 Cookie 裡, 以便 HTTP 請求

This commit is contained in:
CrescentLeaf
2025-09-25 14:17:29 +08:00
parent 8e15c8126f
commit b6be09ef7c

View File

@@ -67,8 +67,11 @@ class Client {
const re = await this.invoke("User.auth", {
access_token: token
}, timeout)
if (re.code == 200)
if (re.code == 200) {
await this.updateCachedProfile()
document.cookie = 'token=' + token
document.cookie = 'device_id=' + data.device_id
}
return re
}
static async updateCachedProfile() {