Browse Source

feat: 修改配置

snihwxf 3 months ago
parent
commit
666726dd87

+ 4 - 0
apps/web-baicai/src/store/app.ts

@@ -36,6 +36,10 @@ export const useAppStore = defineStore('web-info', {
   state: (): AccessState => ({
     appInfo: null,
   }),
+  persist: {
+    // 持久化
+    pick: ['appInfo.webWatermark'],
+  },
 });
 
 // 解决热更新问题

+ 0 - 21
apps/web-baicai/src/views/system/config/index.vue

@@ -1,11 +1,7 @@
 <script lang="ts" setup>
 import type { OnActionClickParams, VxeTableGridOptions } from '#/adapter';
 
-import { watch } from 'vue';
-
 import { Page, useVbenModal } from '@vben/common-ui';
-import { useWatermark } from '@vben/hooks';
-import { preferences } from '@vben/preferences';
 
 import { Button, message } from 'ant-design-vue';
 
@@ -22,23 +18,6 @@ const [FormEditModal, formEditApi] = useVbenModal({
 });
 
 const appStore = useAppStore();
-const { destroyWatermark, updateWatermark } = useWatermark();
-
-watch(
-  () => preferences.app.watermark,
-  async (enable) => {
-    if (enable) {
-      await updateWatermark({
-        content: appStore.appInfo?.webWatermark,
-      });
-    } else {
-      destroyWatermark();
-    }
-  },
-  {
-    immediate: true,
-  },
-);
 
 const handelSuccess = async () => {
   await reload();