chore: 客戶端自動添加 token 和 device_id 到 Cookie 裡, 以便 HTTP 請求
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user