From 8243900f9695009af9e0842261a5a8b62c3d436b Mon Sep 17 00:00:00 2001 From: ko1234 Date: Thu, 21 Aug 2025 14:07:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E9=A0=90=E8=A6=BD2D=E5=9C=96?= =?UTF-8?q?=E7=89=87=E6=99=82=E7=9A=84=E9=8C=AF=E8=AA=A4=20|=20=E7=99=BB?= =?UTF-8?q?=E5=85=A5UI=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/useBuildingStore.js | 4 ++-- src/views/dashboard/Dashboard.vue | 12 ++++++------ src/views/login/Login.vue | 6 +++--- src/views/system/System.vue | 13 ++++++------- 4 files changed, 17 insertions(+), 18 deletions(-) diff --git a/src/stores/useBuildingStore.js b/src/stores/useBuildingStore.js index 73df0b3..31f75c2 100644 --- a/src/stores/useBuildingStore.js +++ b/src/stores/useBuildingStore.js @@ -84,8 +84,8 @@ const useBuildingStore = defineStore("buildingInfo", () => { // 獲取2D、3D顯示與否 const fetchDashboard2D3D = async (BuildingId) => { const res = await getDashboard2D3D(BuildingId); - showForgeArea.value = res.data.is3DEnabled || false; - previewImageExt.value = res.data.previewImageExt || ""; + showForgeArea.value = res.data?.is3DEnabled || false; + previewImageExt.value = res.data?.previewImageExt || ""; }; // 清除localStorage建築物 diff --git a/src/views/dashboard/Dashboard.vue b/src/views/dashboard/Dashboard.vue index ea8eea3..3291565 100644 --- a/src/views/dashboard/Dashboard.vue +++ b/src/views/dashboard/Dashboard.vue @@ -41,12 +41,12 @@ watch( ); watch( - () => store.previewImageExt, - (newExt) => { - if (formState.value.building_guid) { - imgBaseUrl.value = newExt - ? `${FILE_BASEURL}/upload/setting/previewImage/${formState.value.building_guid}${newExt}` - : "/build_img.jpg"; + [() => store.previewImageExt, () => formState.value.building_guid], + ([newExt, buildingGuid]) => { + if (newExt && buildingGuid) { + imgBaseUrl.value = `${FILE_BASEURL}/upload/setting/previewImage/${buildingGuid}${newExt}`; + } else { + imgBaseUrl.value = `${FILE_BASEURL}/upload/build_img.jpg`; } }, { immediate: true } diff --git a/src/views/login/Login.vue b/src/views/login/Login.vue index a1ccc59..f5af3fb 100644 --- a/src/views/login/Login.vue +++ b/src/views/login/Login.vue @@ -54,7 +54,7 @@ const doLogin = async () => {