This commit is contained in:
Baobhan Sith
2025-04-24 20:59:05 +08:00
parent e3139457ff
commit 2ca01ffd04
6 changed files with 33 additions and 23 deletions
+2 -2
View File
@@ -13,8 +13,8 @@ server {
# Proxy API requests to the backend service
location /api/ {
rewrite ^/api(/.*)$ $1 break; # Remove /api prefix before proxying
proxy_pass http://backend:3001; # Proxy to backend root
# rewrite ^/api(/.*)$ $1 break; # Remove /api prefix before proxying - REMOVED to match backend routes
proxy_pass http://backend:3001; # Proxy to backend root, backend expects /api/v1/...
# Standard proxy headers
proxy_set_header Host $host;
@@ -255,6 +255,21 @@ export const useLayoutStore = defineStore('layout', () => {
sidebarPanes.value = getDefaultSidebarPanes();
}
}
// --- Final Check: Ensure defaults are applied if loading failed or resulted in null ---
if (!layoutTree.value) {
console.warn('[Layout Store] Layout tree is still null after all loading attempts. Applying default layout.');
layoutTree.value = getDefaultLayout();
// Optionally save the default to localStorage now?
// try { localStorage.setItem(LAYOUT_STORAGE_KEY, JSON.stringify(layoutTree.value)); } catch(e) {}
}
// Basic check for sidebarPanes structure validity before potentially applying default
if (!sidebarPanes.value || !Array.isArray(sidebarPanes.value.left) || !Array.isArray(sidebarPanes.value.right)) {
console.warn('[Layout Store] Sidebar panes are null or invalid after all loading attempts. Applying default sidebar panes.');
sidebarPanes.value = getDefaultSidebarPanes();
// Optionally save the default to localStorage now?
// try { localStorage.setItem(SIDEBAR_STORAGE_KEY, JSON.stringify(sidebarPanes.value)); } catch(e) {}
}
}
// --- Helper for debounced persistence ---