From fff16d121315d341856e8c9a3023ca5286000048 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E9=B9=8F?= Date: Thu, 21 Nov 2024 14:50:43 +0800 Subject: [PATCH] =?UTF-8?q?feat:=201.=20=E5=AE=8C=E6=88=90=E9=94=81?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E7=9B=B8=E5=85=B3=E5=8A=9F=E8=83=BD=202.=20?= =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=BB=91=E5=AE=9A=E9=94=81=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- starCloud.js | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/starCloud.js b/starCloud.js index 08d961b..5195bb4 100644 --- a/starCloud.js +++ b/starCloud.js @@ -561,7 +561,7 @@ export const useStarCloudStore = defineStore('starCloud', { this.searchDeviceList = list callback( - new Result(Result.Success, { + new Result(Result.Success.code, { list }) ) @@ -666,10 +666,17 @@ export const useStarCloudStore = defineStore('starCloud', { if (bindLockResult.code === Result.Success.code) { this.updateLockInfo({ lockId: bindLockResult.data.lockId, - keyId: bindLockResult.data.keyId + keyId: bindLockResult.data.keyId, + adminPwd: password }) } - return bindLockResult + return new Result( + bindLockResult.code, + { + lock: this.lockInfo + }, + bindLockResult.message + ) } return connectResult }, @@ -806,19 +813,19 @@ export const useStarCloudStore = defineStore('starCloud', { username: accountInfo.username, password: accountInfo.password, token: userInfo.access_token, - uid: userInfo.cloudUid + uid: userInfo.uid } setStorage('starCloudToken', userInfo.access_token) - accounts[userInfo.cloudUid] = { - uid: userInfo.cloudUid, + accounts[userInfo.uid] = { + uid: userInfo.uid, username: accountInfo.username, password: accountInfo.password, token: userInfo.access_token } setStorage('starCloudAccount', accounts) - userInfos[userInfo.cloudUid] = userInfo + userInfos[userInfo.uid] = userInfo setStorage('starCloudUser', userInfo) // 获取服务器时间 @@ -929,7 +936,7 @@ export const useStarCloudStore = defineStore('starCloud', { await this.getServerTimestamp() const nowTime = this.serverTimestamp const date = new Date() - const localTime = Math.floor(date.getTime() / 1000) - date.getTimezoneOffset() * 60 + const localTime = this.serverTimestamp - date.getTimezoneOffset() * 60 for (let i = 0; i < name.length; i++) { contentArray[i + 2] = name.charCodeAt(i)