Merge branch 'fanpeng' into 'develop'
Fanpeng See merge request StarlockTeam/starcloud-sdk-miniprogram!2
This commit is contained in:
commit
83bd441bbf
@ -59,7 +59,7 @@ export class Result {
|
||||
[Result.codes.NotTokenLock, { message: '用户在锁端token失效', data: {} }],
|
||||
[Result.codes.NotMoreKeyLock, { message: '锁端钥匙数量已达上限', data: {} }],
|
||||
[Result.codes.ReadyHasKeyLock, { message: '用户已是锁端用户', data: {} }],
|
||||
[Result.codes.ReadyHasPassword, { message: '该密码已存在', data: {} }]
|
||||
[Result.codes.ReadyHasPassword, { message: '该密码已存在,请更换。', data: {} }]
|
||||
])
|
||||
|
||||
constructor(code, data, message) {
|
||||
|
||||
@ -1180,13 +1180,12 @@ export const useStarCloudStore = defineStore('starCloud', {
|
||||
}
|
||||
|
||||
const { code, data, message } = await getLockSettingDataRequest({
|
||||
lockId: lockId
|
||||
lockId
|
||||
})
|
||||
if (code === Result.Success.code) {
|
||||
return new Result(code, { ...data.lockFeature }, message)
|
||||
} else {
|
||||
return new Result(code, data, message)
|
||||
}
|
||||
return new Result(code, data, message)
|
||||
},
|
||||
|
||||
/**
|
||||
@ -1301,7 +1300,6 @@ export const useStarCloudStore = defineStore('starCloud', {
|
||||
|
||||
setStorage('starCloudToken', this.accountInfo.token)
|
||||
|
||||
this.getServerTimestamp().then(() => {})
|
||||
return Result.Success
|
||||
}
|
||||
|
||||
@ -1868,9 +1866,9 @@ export const useStarCloudStore = defineStore('starCloud', {
|
||||
lockId: this.lockInfo.lockId
|
||||
})
|
||||
return characteristicValueCallback(new Result(result.code))
|
||||
} else {
|
||||
characteristicValueCallback(new Result(decrypted[2]))
|
||||
}
|
||||
characteristicValueCallback(new Result(decrypted[2]))
|
||||
|
||||
break
|
||||
case subCmdIds.resetLockPassword:
|
||||
this.updateLockInfo({
|
||||
@ -1948,7 +1946,7 @@ export const useStarCloudStore = defineStore('starCloud', {
|
||||
user: decrypted[8 + 17 * i] * 256 + decrypted[9 + 17 * i],
|
||||
date: arrayToTimestamp(decrypted.slice(10 + 17 * i, 14 + 17 * i)) * 1000,
|
||||
success: 1,
|
||||
password: password
|
||||
password
|
||||
}
|
||||
records.push(record)
|
||||
}
|
||||
@ -1988,21 +1986,6 @@ export const useStarCloudStore = defineStore('starCloud', {
|
||||
}
|
||||
characteristicValueCallback(new Result(decrypted[6], { lock: this.lockInfo }))
|
||||
break
|
||||
case cmdIds.resetDevice:
|
||||
this.updateLockInfo({
|
||||
token: decrypted.slice(2, 6),
|
||||
electricQuantity: decrypted[7],
|
||||
electricQuantityStandby: decrypted[9]
|
||||
})
|
||||
if (decrypted[6] === Result.Success.code) {
|
||||
updateElectricQuantityRequest({
|
||||
lockId: this.lockInfo.lockId,
|
||||
electricQuantity: decrypted[7],
|
||||
electricQuantityStandby: decrypted[9]
|
||||
})
|
||||
}
|
||||
characteristicValueCallback(new Result(decrypted[6], { lock: this.lockInfo }))
|
||||
break
|
||||
case cmdIds.resetDevice:
|
||||
this.updateLockInfo({
|
||||
token: decrypted.slice(2, 6)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user