mirror of
https://github.com/Macrame-App/Macrame
synced 2025-12-29 15:29:26 +00:00
Frontend refactor and additions
This commit is contained in:
parent
5de99b32cd
commit
2a9813e7ac
12 changed files with 195 additions and 26 deletions
|
|
@ -50,10 +50,19 @@ export const useDeviceStore = defineStore('device', () => {
|
|||
localStorage.removeItem('deviceKey')
|
||||
}
|
||||
|
||||
const serverGetIP = async () => {
|
||||
const request = await axios.post(appUrl() + '/device/server/ip')
|
||||
return request.data
|
||||
}
|
||||
|
||||
// Server application
|
||||
const serverGetRemotes = async (remoteUuid) => {
|
||||
axios.post(appUrl() + '/device/list', { uuid: remoteUuid }).then((data) => {
|
||||
if (data.data.devices) remote.value = data.data.devices
|
||||
// console.log(data.data.devices)
|
||||
if (data.data.devices) {
|
||||
console.log(data.data.devices)
|
||||
remote.value = data.data.devices
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -100,6 +109,8 @@ export const useDeviceStore = defineStore('device', () => {
|
|||
shake: encryptAES(keyStr, getDateStr()),
|
||||
})
|
||||
|
||||
if (!handshake.data) removeDeviceKey()
|
||||
|
||||
return handshake.data
|
||||
}
|
||||
|
||||
|
|
@ -111,6 +122,7 @@ export const useDeviceStore = defineStore('device', () => {
|
|||
key,
|
||||
setDeviceKey,
|
||||
removeDeviceKey,
|
||||
serverGetIP,
|
||||
serverGetRemotes,
|
||||
serverStartLink,
|
||||
remoteCheckServerAccess,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue