diff --git a/fe/src/services/ApiService.js b/fe/src/services/ApiService.js index 74697d8..f1e8dc0 100644 --- a/fe/src/services/ApiService.js +++ b/fe/src/services/ApiService.js @@ -7,7 +7,7 @@ export const appUrl = () => { return `http://${window.location.hostname}:${port}` } -export const isLocal = () => { +export const isLocal = () => { return window.location.hostname === '127.0.0.1' || window.location.hostname === 'localhost' } diff --git a/fe/src/services/EncryptService.js b/fe/src/services/EncryptService.js index 8890b72..1b2574a 100644 --- a/fe/src/services/EncryptService.js +++ b/fe/src/services/EncryptService.js @@ -24,9 +24,11 @@ export const decryptAES = (key, str) => { return encrypted.toString(enc.Utf8) } -export const AuthCall = (data) => { +export const AuthCall = (data = false) => { if (isLocal()) return data + if (!data) data = {empty: true} + const device = useDeviceStore() return { diff --git a/fe/src/stores/panel.js b/fe/src/stores/panel.js index 915bec9..5896c10 100644 --- a/fe/src/stores/panel.js +++ b/fe/src/stores/panel.js @@ -39,7 +39,9 @@ export const usePanelStore = defineStore('panel', () => { const getList = async () => { if (list.value.length > 0) return list.value - const resp = await axios.post(appUrl() + '/panel/list') + const data = AuthCall() + + const resp = await axios.post(appUrl() + '/panel/list', data) list.value = resp.data return list.value diff --git a/fe/src/views/DashboardView.vue b/fe/src/views/DashboardView.vue index 962b7cc..20239dc 100644 --- a/fe/src/views/DashboardView.vue +++ b/fe/src/views/DashboardView.vue @@ -5,7 +5,7 @@