From 98cba51541b9a450b91c9ccf3b023749b9737dfc Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: 星期六, 21 十月 2023 14:31:24 +0800
Subject: [PATCH] 登录不做数据重复提交验证

---
 src/layout/index.vue |   31 +++++++++++++++++--------------
 1 files changed, 17 insertions(+), 14 deletions(-)

diff --git a/src/layout/index.vue b/src/layout/index.vue
index 8d59143..4d04ea0 100644
--- a/src/layout/index.vue
+++ b/src/layout/index.vue
@@ -9,7 +9,7 @@
       </div>
       <app-main />
       <settings ref="settingRef" />
-    </div>
+    </div> 
   </div>
 </template>
 
@@ -19,13 +19,16 @@
 import { AppMain, Navbar, Settings, TagsView } from './components'
 import defaultSettings from '@/settings'
 
-const store = useStore();
-const theme = computed(() => store.state.settings.theme);
-const sideTheme = computed(() => store.state.settings.sideTheme);
-const sidebar = computed(() => store.state.app.sidebar);
-const device = computed(() => store.state.app.device);
-const needTagsView = computed(() => store.state.settings.tagsView);
-const fixedHeader = computed(() => store.state.settings.fixedHeader);
+import useAppStore from '@/store/modules/app'
+import useSettingsStore from '@/store/modules/settings'
+
+const settingsStore = useSettingsStore()
+const theme = computed(() => settingsStore.theme);
+const sideTheme = computed(() => settingsStore.sideTheme);
+const sidebar = computed(() => useAppStore().sidebar);
+const device = computed(() => useAppStore().device);
+const needTagsView = computed(() => settingsStore.tagsView);
+const fixedHeader = computed(() => settingsStore.fixedHeader);
 
 const classObj = computed(() => ({
   hideSidebar: !sidebar.value.opened,
@@ -39,18 +42,18 @@
 
 watchEffect(() => {
   if (device.value === 'mobile' && sidebar.value.opened) {
-    store.dispatch('app/closeSideBar', { withoutAnimation: false })
+    useAppStore().closeSideBar({ withoutAnimation: false })
   }
   if (width.value - 1 < WIDTH) {
-    store.dispatch('app/toggleDevice', 'mobile')
-    store.dispatch('app/closeSideBar', { withoutAnimation: true })
+    useAppStore().toggleDevice('mobile')
+    useAppStore().closeSideBar({ withoutAnimation: true })
   } else {
-    store.dispatch('app/toggleDevice', 'desktop')
+    useAppStore().toggleDevice('desktop')
   }
 })
 
 function handleClickOutside() {
-  store.dispatch('app/closeSideBar', { withoutAnimation: false })
+  useAppStore().closeSideBar({ withoutAnimation: false })
 }
 
 const settingRef = ref(null);
@@ -99,7 +102,7 @@
 }
 
 .sidebarHide .fixed-header {
-  width: calc(100%);
+  width: 100%;
 }
 
 .mobile .fixed-header {

--
Gitblit v1.9.3