fix: 优化开锁速度,添加开锁实时日志
This commit is contained in:
parent
f92782e137
commit
a888ce7415
@ -46,6 +46,7 @@ const $starCloud = useStarCloudStore()
|
|||||||
* @param {String} params.clientId 客户端Id
|
* @param {String} params.clientId 客户端Id
|
||||||
* @param {String} params.clientSecret 客户端密码
|
* @param {String} params.clientSecret 客户端密码
|
||||||
* @param {String} params.env 环境
|
* @param {String} params.env 环境
|
||||||
|
* @param {Boolean} params.isReportLog 是否上报日志
|
||||||
*/
|
*/
|
||||||
$starCloud.initStarCloud(params)
|
$starCloud.initStarCloud(params)
|
||||||
|
|
||||||
|
|||||||
40
log.js
Normal file
40
log.js
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
import { isReportLog } from '@/starCloud/starCloud'
|
||||||
|
|
||||||
|
const log = wx.getRealtimeLogManager ? wx.getRealtimeLogManager() : null
|
||||||
|
|
||||||
|
export default {
|
||||||
|
debug() {
|
||||||
|
if (!log) return
|
||||||
|
if (!isReportLog) return
|
||||||
|
log.debug.apply(log, arguments)
|
||||||
|
},
|
||||||
|
info() {
|
||||||
|
if (!log) return
|
||||||
|
if (!isReportLog) return
|
||||||
|
log.info.apply(log, arguments)
|
||||||
|
},
|
||||||
|
warn() {
|
||||||
|
if (!log) return
|
||||||
|
if (!isReportLog) return
|
||||||
|
log.warn.apply(log, arguments)
|
||||||
|
},
|
||||||
|
error() {
|
||||||
|
if (!log) return
|
||||||
|
if (!isReportLog) return
|
||||||
|
log.error.apply(log, arguments)
|
||||||
|
},
|
||||||
|
setFilterMsg(msg) {
|
||||||
|
// 从基础库2.7.3开始支持
|
||||||
|
if (!log || !log.setFilterMsg) return
|
||||||
|
if (typeof msg !== 'string') return
|
||||||
|
if (!isReportLog) return
|
||||||
|
log.setFilterMsg(msg)
|
||||||
|
},
|
||||||
|
addFilterMsg(msg) {
|
||||||
|
// 从基础库2.8.1开始支持
|
||||||
|
if (!log || !log.addFilterMsg) return
|
||||||
|
if (typeof msg !== 'string') return
|
||||||
|
if (!isReportLog) return
|
||||||
|
log.addFilterMsg(msg)
|
||||||
|
}
|
||||||
|
}
|
||||||
235
starCloud.js
235
starCloud.js
@ -43,6 +43,7 @@ import {
|
|||||||
timestampToArray,
|
timestampToArray,
|
||||||
uint8ArrayToString
|
uint8ArrayToString
|
||||||
} from '@/starCloud/format'
|
} from '@/starCloud/format'
|
||||||
|
import log from '@/starCloud/log'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 离线密码
|
* 离线密码
|
||||||
@ -139,6 +140,9 @@ import {
|
|||||||
* @property {String} userNos - 设备ID
|
* @property {String} userNos - 设备ID
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// 是否上报日志
|
||||||
|
export const isReportLog = false
|
||||||
|
|
||||||
// 命令ID
|
// 命令ID
|
||||||
const cmdIds = {
|
const cmdIds = {
|
||||||
// 获取公钥
|
// 获取公钥
|
||||||
@ -216,12 +220,15 @@ export const useStarCloudStore = defineStore('starCloud', {
|
|||||||
* @param {String} params.clientId 客户端Id
|
* @param {String} params.clientId 客户端Id
|
||||||
* @param {String} params.clientSecret 客户端密码
|
* @param {String} params.clientSecret 客户端密码
|
||||||
* @param {String} params.env 环境
|
* @param {String} params.env 环境
|
||||||
|
* @param {Boolean} params.isReportLog 是否上报日志
|
||||||
*/
|
*/
|
||||||
initStarCloud(params) {
|
initStarCloud(params) {
|
||||||
const { clientId, clientSecret, env } = params
|
const { clientId, clientSecret, env } = params
|
||||||
const appInfo = uni.getAccountInfoSync()
|
const appInfo = uni.getAccountInfoSync()
|
||||||
this.envVersion = appInfo.miniProgram.envVersion
|
this.envVersion = appInfo.miniProgram.envVersion
|
||||||
|
|
||||||
|
isReportLog = params.isReportLog
|
||||||
|
|
||||||
this.env = env || 'XHJ'
|
this.env = env || 'XHJ'
|
||||||
this.clientId = clientId
|
this.clientId = clientId
|
||||||
this.clientSecret = clientSecret
|
this.clientSecret = clientSecret
|
||||||
@ -271,25 +278,26 @@ export const useStarCloudStore = defineStore('starCloud', {
|
|||||||
lockId
|
lockId
|
||||||
})
|
})
|
||||||
if (code === Result.Success.code) {
|
if (code === Result.Success.code) {
|
||||||
let lockList = getStorage('lockList')
|
this.lockInfo = data
|
||||||
|
let lockList = getStorage('starLockList')
|
||||||
if (!lockList) {
|
if (!lockList) {
|
||||||
lockList = {}
|
lockList = {}
|
||||||
}
|
}
|
||||||
if (lockList[accountInfo.uid]) {
|
if (lockList[accountInfo.uid]) {
|
||||||
const index = lockList[accountInfo.uid].findIndex(item => item.lockId === lockId)
|
const index = lockList[accountInfo.uid].findIndex(item => item.lockId === lockId)
|
||||||
if (index === -1) {
|
if (index === -1) {
|
||||||
lockList[accountInfo.uid].push(data)
|
lockList[accountInfo.uid].push(this.lockInfo)
|
||||||
} else {
|
} else {
|
||||||
lockList[accountInfo.uid][index] = data
|
this.lockInfo.token = lockList[accountInfo.uid][index].token
|
||||||
|
lockList[accountInfo.uid][index] = this.lockInfo
|
||||||
}
|
}
|
||||||
setStorage('lockList', lockList)
|
setStorage('starLockList', lockList)
|
||||||
} else {
|
} else {
|
||||||
lockList[accountInfo.uid] = [data]
|
lockList[accountInfo.uid] = [this.lockInfo]
|
||||||
setStorage('lockList', lockList)
|
setStorage('starLockList', lockList)
|
||||||
}
|
}
|
||||||
this.lockInfo = data
|
|
||||||
} else {
|
} else {
|
||||||
const lockList = getStorage('lockList')
|
const lockList = getStorage('starLockList')
|
||||||
if (lockList[accountInfo.uid]) {
|
if (lockList[accountInfo.uid]) {
|
||||||
const index = lockList[accountInfo.uid].findIndex(item => item.lockId === lockId)
|
const index = lockList[accountInfo.uid].findIndex(item => item.lockId === lockId)
|
||||||
if (index !== -1) {
|
if (index !== -1) {
|
||||||
@ -310,18 +318,61 @@ export const useStarCloudStore = defineStore('starCloud', {
|
|||||||
*/
|
*/
|
||||||
async openDoor(params) {
|
async openDoor(params) {
|
||||||
const { accountInfo, type } = params
|
const { accountInfo, type } = params
|
||||||
|
|
||||||
|
log.info(
|
||||||
|
new Result(
|
||||||
|
Result.Success.code,
|
||||||
|
{
|
||||||
|
lockName: this.lockInfo.bluetooth.bluetoothDeviceName,
|
||||||
|
lockId: this.lockInfo.lockId,
|
||||||
|
uid: accountInfo.uid,
|
||||||
|
time: new Date().getTime()
|
||||||
|
},
|
||||||
|
`开始开门`
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
// 设置执行账号
|
// 设置执行账号
|
||||||
const result = await this.login(accountInfo)
|
const result = await this.login(accountInfo)
|
||||||
if (result.code !== Result.Success.code) {
|
if (result.code !== Result.Success.code) {
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log.info(
|
||||||
|
new Result(
|
||||||
|
result.code,
|
||||||
|
{
|
||||||
|
lockName: this.lockInfo.bluetooth.bluetoothDeviceName,
|
||||||
|
lockId: this.lockInfo.lockId,
|
||||||
|
uid: accountInfo.uid,
|
||||||
|
time: new Date().getTime()
|
||||||
|
},
|
||||||
|
`登录星云账号: ${result.message}`
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
// 确认设备连接正常
|
// 确认设备连接正常
|
||||||
const searchResult = await searchAndConnectDevice(this.lockInfo.bluetooth.bluetoothDeviceName)
|
if (!params.connected) {
|
||||||
if (searchResult.code !== Result.Success.code) {
|
const searchResult = await searchAndConnectDevice(
|
||||||
return searchResult
|
this.lockInfo.bluetooth.bluetoothDeviceName
|
||||||
|
)
|
||||||
|
log.info(
|
||||||
|
new Result(
|
||||||
|
searchResult.code,
|
||||||
|
{
|
||||||
|
lockName: this.lockInfo.bluetooth.bluetoothDeviceName,
|
||||||
|
lockId: this.lockInfo.lockId,
|
||||||
|
uid: accountInfo.uid,
|
||||||
|
time: new Date().getTime()
|
||||||
|
},
|
||||||
|
`连接设备: ${searchResult.message}`
|
||||||
|
)
|
||||||
|
)
|
||||||
|
if (searchResult.code !== Result.Success.code) {
|
||||||
|
return searchResult
|
||||||
|
}
|
||||||
|
this.updateLockInfo(searchResult.data)
|
||||||
}
|
}
|
||||||
this.updateLockInfo(searchResult.data)
|
|
||||||
|
|
||||||
// 检查是否已添加为用户
|
// 检查是否已添加为用户
|
||||||
const checkResult = await this.checkLockUser()
|
const checkResult = await this.checkLockUser()
|
||||||
@ -329,6 +380,19 @@ export const useStarCloudStore = defineStore('starCloud', {
|
|||||||
return checkResult
|
return checkResult
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log.info(
|
||||||
|
new Result(
|
||||||
|
checkResult.code,
|
||||||
|
{
|
||||||
|
lockName: this.lockInfo.bluetooth.bluetoothDeviceName,
|
||||||
|
lockId: this.lockInfo.lockId,
|
||||||
|
uid: accountInfo.uid,
|
||||||
|
time: new Date().getTime()
|
||||||
|
},
|
||||||
|
`确认是否为锁用户: ${checkResult.message}`
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
// 是否需要联网
|
// 是否需要联网
|
||||||
let onlineToken = ''
|
let onlineToken = ''
|
||||||
if (this.lockInfo.lockSetting.appUnlockOnline) {
|
if (this.lockInfo.lockSetting.appUnlockOnline) {
|
||||||
@ -340,6 +404,19 @@ export const useStarCloudStore = defineStore('starCloud', {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log.info(
|
||||||
|
new Result(
|
||||||
|
checkResult.code,
|
||||||
|
{
|
||||||
|
lockName: this.lockInfo.bluetooth.bluetoothDeviceName,
|
||||||
|
lockId: this.lockInfo.lockId,
|
||||||
|
uid: accountInfo.uid,
|
||||||
|
time: new Date().getTime()
|
||||||
|
},
|
||||||
|
`判断是否需要联网token: ${this.lockInfo.lockSetting.appUnlockOnline}`
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
// 开门方式
|
// 开门方式
|
||||||
let openMode
|
let openMode
|
||||||
if (type === 'close') {
|
if (type === 'close') {
|
||||||
@ -396,6 +473,19 @@ export const useStarCloudStore = defineStore('starCloud', {
|
|||||||
|
|
||||||
const packageArray = createPackageEnd(headArray, cebArray)
|
const packageArray = createPackageEnd(headArray, cebArray)
|
||||||
|
|
||||||
|
log.info(
|
||||||
|
new Result(
|
||||||
|
Result.Success.code,
|
||||||
|
{
|
||||||
|
lockName: this.lockInfo.bluetooth.bluetoothDeviceName,
|
||||||
|
lockId: this.lockInfo.lockId,
|
||||||
|
uid: accountInfo.uid,
|
||||||
|
time: new Date().getTime()
|
||||||
|
},
|
||||||
|
`开始写入`
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
const writeResult = await writeBLECharacteristicValue(
|
const writeResult = await writeBLECharacteristicValue(
|
||||||
this.lockInfo.deviceId,
|
this.lockInfo.deviceId,
|
||||||
this.lockInfo.serviceId,
|
this.lockInfo.serviceId,
|
||||||
@ -407,6 +497,19 @@ export const useStarCloudStore = defineStore('starCloud', {
|
|||||||
return writeResult
|
return writeResult
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log.info(
|
||||||
|
new Result(
|
||||||
|
writeResult.code,
|
||||||
|
{
|
||||||
|
lockName: this.lockInfo.bluetooth.bluetoothDeviceName,
|
||||||
|
lockId: this.lockInfo.lockId,
|
||||||
|
uid: accountInfo.uid,
|
||||||
|
time: new Date().getTime()
|
||||||
|
},
|
||||||
|
`写入完成:${writeResult.message}`
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
return this.getWriteResult(this.openDoor, params)
|
return this.getWriteResult(this.openDoor, params)
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
@ -442,11 +545,15 @@ export const useStarCloudStore = defineStore('starCloud', {
|
|||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
// 确认设备连接正常
|
// 确认设备连接正常
|
||||||
const searchResult = await searchAndConnectDevice(this.lockInfo.bluetooth.bluetoothDeviceName)
|
if (!params.connected) {
|
||||||
if (searchResult.code !== Result.Success.code) {
|
const searchResult = await searchAndConnectDevice(
|
||||||
return searchResult
|
this.lockInfo.bluetooth.bluetoothDeviceName
|
||||||
|
)
|
||||||
|
if (searchResult.code !== Result.Success.code) {
|
||||||
|
return searchResult
|
||||||
|
}
|
||||||
|
this.updateLockInfo(searchResult.data)
|
||||||
}
|
}
|
||||||
this.updateLockInfo(searchResult.data)
|
|
||||||
|
|
||||||
// 检查是否已添加为用户
|
// 检查是否已添加为用户
|
||||||
const checkResult = await this.checkLockUser()
|
const checkResult = await this.checkLockUser()
|
||||||
@ -707,7 +814,7 @@ export const useStarCloudStore = defineStore('starCloud', {
|
|||||||
lockIds: params.lockIds
|
lockIds: params.lockIds
|
||||||
})
|
})
|
||||||
if (code === Result.Success.code) {
|
if (code === Result.Success.code) {
|
||||||
const lockList = getStorage('lockList')
|
const lockList = getStorage('starLockList')
|
||||||
if (lockList[accountInfo.uid]) {
|
if (lockList[accountInfo.uid]) {
|
||||||
lockIds.forEach(lockId => {
|
lockIds.forEach(lockId => {
|
||||||
const index = lockList[accountInfo.uid].findIndex(item => item.lockId === lockId)
|
const index = lockList[accountInfo.uid].findIndex(item => item.lockId === lockId)
|
||||||
@ -715,7 +822,7 @@ export const useStarCloudStore = defineStore('starCloud', {
|
|||||||
lockList[accountInfo.uid].splice(index, 1)
|
lockList[accountInfo.uid].splice(index, 1)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
setStorage('lockList', lockList)
|
setStorage('starLockList', lockList)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -734,11 +841,15 @@ export const useStarCloudStore = defineStore('starCloud', {
|
|||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
// 确认设备连接正常
|
// 确认设备连接正常
|
||||||
const searchResult = await searchAndConnectDevice(this.lockInfo.bluetooth.bluetoothDeviceName)
|
if (!params.connected) {
|
||||||
if (searchResult.code !== Result.Success.code) {
|
const searchResult = await searchAndConnectDevice(
|
||||||
return searchResult
|
this.lockInfo.bluetooth.bluetoothDeviceName
|
||||||
|
)
|
||||||
|
if (searchResult.code !== Result.Success.code) {
|
||||||
|
return searchResult
|
||||||
|
}
|
||||||
|
this.updateLockInfo(searchResult.data)
|
||||||
}
|
}
|
||||||
this.updateLockInfo(searchResult.data)
|
|
||||||
|
|
||||||
// 检查是否已添加为用户
|
// 检查是否已添加为用户
|
||||||
const checkResult = await this.checkLockUser()
|
const checkResult = await this.checkLockUser()
|
||||||
@ -812,11 +923,15 @@ export const useStarCloudStore = defineStore('starCloud', {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 确认设备连接正常
|
// 确认设备连接正常
|
||||||
const searchResult = await searchAndConnectDevice(this.lockInfo.bluetooth.bluetoothDeviceName)
|
if (!params.connected) {
|
||||||
if (searchResult.code !== Result.Success.code) {
|
const searchResult = await searchAndConnectDevice(
|
||||||
return searchResult
|
this.lockInfo.bluetooth.bluetoothDeviceName
|
||||||
|
)
|
||||||
|
if (searchResult.code !== Result.Success.code) {
|
||||||
|
return searchResult
|
||||||
|
}
|
||||||
|
this.updateLockInfo(searchResult.data)
|
||||||
}
|
}
|
||||||
this.updateLockInfo(searchResult.data)
|
|
||||||
|
|
||||||
// 检查是否已添加为用户
|
// 检查是否已添加为用户
|
||||||
const checkResult = await this.checkLockUser()
|
const checkResult = await this.checkLockUser()
|
||||||
@ -948,11 +1063,15 @@ export const useStarCloudStore = defineStore('starCloud', {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 确认设备连接正常
|
// 确认设备连接正常
|
||||||
const searchResult = await searchAndConnectDevice(this.lockInfo.bluetooth.bluetoothDeviceName)
|
if (!params.connected) {
|
||||||
if (searchResult.code !== Result.Success.code) {
|
const searchResult = await searchAndConnectDevice(
|
||||||
return searchResult
|
this.lockInfo.bluetooth.bluetoothDeviceName
|
||||||
|
)
|
||||||
|
if (searchResult.code !== Result.Success.code) {
|
||||||
|
return searchResult
|
||||||
|
}
|
||||||
|
this.updateLockInfo(searchResult.data)
|
||||||
}
|
}
|
||||||
this.updateLockInfo(searchResult.data)
|
|
||||||
|
|
||||||
// 检查是否已添加为用户
|
// 检查是否已添加为用户
|
||||||
const checkResult = await this.checkLockUser()
|
const checkResult = await this.checkLockUser()
|
||||||
@ -1337,15 +1456,18 @@ export const useStarCloudStore = defineStore('starCloud', {
|
|||||||
// 添加用户
|
// 添加用户
|
||||||
async addLockUser(params) {
|
async addLockUser(params) {
|
||||||
const { params: data } = params
|
const { params: data } = params
|
||||||
|
|
||||||
// 确认设备连接正常
|
// 确认设备连接正常
|
||||||
const searchResult = await searchAndConnectDevice(
|
if (!params.connected) {
|
||||||
this.lockInfo.bluetooth.bluetoothDeviceName,
|
const searchResult = await searchAndConnectDevice(
|
||||||
data.role !== 0xff
|
this.lockInfo.bluetooth.bluetoothDeviceName,
|
||||||
)
|
data.role !== 0xff
|
||||||
if (searchResult.code !== Result.Success.code) {
|
)
|
||||||
return searchResult
|
if (searchResult.code !== Result.Success.code) {
|
||||||
|
return searchResult
|
||||||
|
}
|
||||||
|
this.updateLockInfo(searchResult.data)
|
||||||
}
|
}
|
||||||
this.updateLockInfo(searchResult.data)
|
|
||||||
|
|
||||||
const {
|
const {
|
||||||
name,
|
name,
|
||||||
@ -1451,11 +1573,22 @@ export const useStarCloudStore = defineStore('starCloud', {
|
|||||||
characteristicValueCallback = async data => {
|
characteristicValueCallback = async data => {
|
||||||
// code 6 token过期,重新获取
|
// code 6 token过期,重新获取
|
||||||
if (data.code === Result.NotTokenLock.code) {
|
if (data.code === Result.NotTokenLock.code) {
|
||||||
resolve(await request(params))
|
log.info(
|
||||||
|
new Result(
|
||||||
|
data.code,
|
||||||
|
{
|
||||||
|
lockName: this.lockInfo.bluetooth.bluetoothDeviceName,
|
||||||
|
lockId: this.lockInfo.lockId,
|
||||||
|
time: new Date().getTime()
|
||||||
|
},
|
||||||
|
`token过期:${data.message}`
|
||||||
|
)
|
||||||
|
)
|
||||||
|
resolve(await request({ ...params, connected: true }))
|
||||||
} else if (data.code === Result.NotRegisteredLock.code) {
|
} else if (data.code === Result.NotRegisteredLock.code) {
|
||||||
const checkResult = await this.checkLockUser(true)
|
const checkResult = await this.checkLockUser(true)
|
||||||
if (checkResult.code === Result.Success.code) {
|
if (checkResult.code === Result.Success.code) {
|
||||||
resolve(await request(params))
|
resolve(await request({ ...params, connected: true }))
|
||||||
} else {
|
} else {
|
||||||
clearTimeout(getWriteResultTimer)
|
clearTimeout(getWriteResultTimer)
|
||||||
resolve(checkResult)
|
resolve(checkResult)
|
||||||
@ -1466,6 +1599,17 @@ export const useStarCloudStore = defineStore('starCloud', {
|
|||||||
await this.disconnectDevice()
|
await this.disconnectDevice()
|
||||||
}
|
}
|
||||||
console.log('写入结果', data, request, params)
|
console.log('写入结果', data, request, params)
|
||||||
|
log.info(
|
||||||
|
new Result(
|
||||||
|
data.code,
|
||||||
|
{
|
||||||
|
lockName: this.lockInfo.bluetooth.bluetoothDeviceName,
|
||||||
|
lockId: this.lockInfo.lockId,
|
||||||
|
time: new Date().getTime()
|
||||||
|
},
|
||||||
|
`开门结果:${data.message}`
|
||||||
|
)
|
||||||
|
)
|
||||||
resolve(data)
|
resolve(data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1535,6 +1679,15 @@ export const useStarCloudStore = defineStore('starCloud', {
|
|||||||
...this.lockInfo,
|
...this.lockInfo,
|
||||||
...lockInfo
|
...lockInfo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const lockList = getStorage('starLockList')
|
||||||
|
const index = lockList[this.accountInfo.uid].findIndex(
|
||||||
|
item => item.lockId === this.lockInfo.lockId
|
||||||
|
)
|
||||||
|
if (index !== -1) {
|
||||||
|
lockList[this.accountInfo.uid][index] = this.lockInfo
|
||||||
|
}
|
||||||
|
setStorage('starLockList', lockList)
|
||||||
},
|
},
|
||||||
// 特征值变化回调
|
// 特征值变化回调
|
||||||
listenCharacteristicValue(res) {
|
listenCharacteristicValue(res) {
|
||||||
@ -1811,7 +1964,7 @@ export const useStarCloudStore = defineStore('starCloud', {
|
|||||||
lockId: this.lockInfo.lockId
|
lockId: this.lockInfo.lockId
|
||||||
})
|
})
|
||||||
if (code === Result.Success.code) {
|
if (code === Result.Success.code) {
|
||||||
const lockList = getStorage('lockList')
|
const lockList = getStorage('starLockList')
|
||||||
if (lockList[this.accountInfo.uid]) {
|
if (lockList[this.accountInfo.uid]) {
|
||||||
const index = lockList[this.accountInfo.uid].findIndex(
|
const index = lockList[this.accountInfo.uid].findIndex(
|
||||||
item => item.lockId === this.lockInfo.lockId
|
item => item.lockId === this.lockInfo.lockId
|
||||||
@ -1819,7 +1972,7 @@ export const useStarCloudStore = defineStore('starCloud', {
|
|||||||
if (index !== -1) {
|
if (index !== -1) {
|
||||||
lockList[this.accountInfo.uid].splice(index, 1)
|
lockList[this.accountInfo.uid].splice(index, 1)
|
||||||
}
|
}
|
||||||
setStorage('lockList', lockList)
|
setStorage('starLockList', lockList)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
characteristicValueCallback(new Result(code, {}, message))
|
characteristicValueCallback(new Result(code, {}, message))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user