diff --git a/src/App.vue b/src/App.vue
index 8d74c47..3b141ad 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -10,6 +10,9 @@
+
+
diff --git a/src/components/common/ErrorBoundary.vue b/src/components/common/ErrorBoundary.vue
new file mode 100644
index 0000000..afac496
--- /dev/null
+++ b/src/components/common/ErrorBoundary.vue
@@ -0,0 +1,148 @@
+
+
+
+
+
+
+
+
页面加载失败
+
{{ errorMessage || '当前页面发生了错误,请尝试刷新或返回首页' }}
+
+ 重试
+ 返回首页
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/layout/Layout.vue b/src/components/layout/Layout.vue
index 924d33b..0bdf73f 100644
--- a/src/components/layout/Layout.vue
+++ b/src/components/layout/Layout.vue
@@ -21,10 +21,13 @@
style="height: 100%; display: flex; flex-direction: column"
>
-
-
-
-
+
+
+
+
+
+
+
@@ -40,6 +43,7 @@ defineOptions({
import Header from './Header.vue'
import Sidebar from './Sidebar.vue'
import Tabs from './Tabs.vue'
+import ErrorBoundary from '@/components/common/ErrorBoundary.vue'
import { useTabsStore } from '@/stores/modules/tabs'
const route = useRoute()
diff --git a/src/stores/modules/tabs.ts b/src/stores/modules/tabs.ts
index fbf6708..c35b0da 100644
--- a/src/stores/modules/tabs.ts
+++ b/src/stores/modules/tabs.ts
@@ -263,6 +263,42 @@ export const useTabsStore = defineStore('tabs', () => {
removeStorage('activeTab')
}
+ // 初始化默认首页标签
+ const initDefaultTab = () => {
+ // 检查是否已有有效的标签页
+ if (tabs.value.length === 0) {
+ tabs.value.push({
+ title: '首页',
+ path: '/dashboard'
+ })
+ activeTab.value = '/dashboard'
+ saveTabs()
+ }
+ }
+
+ // 验证并恢复标签页状态(用于应用启动时检查)
+ const validateAndRecoverTabs = () => {
+ const savedTabs = getStorage('tabs')
+ const savedActiveTab = getStorage('activeTab')
+
+ // 如果存储中没有数据或者数据无效
+ if (!savedTabs || !Array.isArray(savedTabs) || savedTabs.length === 0) {
+ initDefaultTab()
+ return
+ }
+
+ // 验证当前激活的标签页是否在列表中
+ if (savedActiveTab && !savedTabs.some((t: TabItem) => t.path === savedActiveTab)) {
+ // 激活的标签页不在列表中,切换到第一个有效的标签页
+ if (savedTabs.length > 0) {
+ activeTab.value = savedTabs[0].path
+ saveTabs()
+ } else {
+ initDefaultTab()
+ }
+ }
+ }
+
// 设置标签页列表(用于拖拽排序)
const setTabs = (newTabs: TabItem[]) => {
tabs.value = newTabs
@@ -293,6 +329,8 @@ export const useTabsStore = defineStore('tabs', () => {
clearTabs,
setTabs,
refreshKey,
- refreshTab
+ refreshTab,
+ initDefaultTab,
+ validateAndRecoverTabs
}
})
diff --git a/src/views/capital/transfer/index.vue b/src/views/capital/transfer/index.vue
index 615824c..4d3cd10 100644
--- a/src/views/capital/transfer/index.vue
+++ b/src/views/capital/transfer/index.vue
@@ -138,7 +138,10 @@ import { useUserStore } from '@/stores/modules/user'
const userStore = useUserStore()
console.log('userStore:', userStore);
import { sendCaptcha, initCaptchaState, clearCaptchaTimer } from '@/utils/sendCaptcha'
-
+const transferFormOptionsMap = ref({
+ transferOutAccount: [],
+ transferInAccount: [],
+}) as any
const { t } = useI18n()
/**
* @description 转账类型
@@ -210,10 +213,7 @@ watch(
)
const transferFormRules = ref(rules(transferForm.value))
-const transferFormOptionsMap = ref({
- transferOutAccount: [],
- transferInAccount: [],
-}) as any
+
/**
* @description 验证方式
diff --git a/src/views/trade/holidays/index.vue b/src/views/trade/holidays/index.vue
index 1feaa13..18436c0 100644
--- a/src/views/trade/holidays/index.vue
+++ b/src/views/trade/holidays/index.vue
@@ -7,8 +7,9 @@
- 搜索
- 重置
+ 搜索
+ 重置
@@ -17,50 +18,25 @@
-