From a9a03d64cf190188d3db04d14970fc0908b03491 Mon Sep 17 00:00:00 2001
From: huangyinfeng <1244041895@qq.com>
Date: 星期五, 27 九月 2024 09:02:26 +0800
Subject: [PATCH] 部分功能

---
 src/App.vue |   81 ++++++++++++++++++++++++----------------
 1 files changed, 48 insertions(+), 33 deletions(-)

diff --git a/src/App.vue b/src/App.vue
index 7462524..0e74772 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -1,41 +1,56 @@
 <template>
-  <ConfigProvider
-    :locale="zhCN"
-    :renderEmpty="renderEmpty"
-    :transformCellText="transformCellText"
-    v-bind="lockOn"
-  >
-    <router-view />
+  <ConfigProvider :locale="getAntdLocale" :theme="themeConfig">
+    <AppProvider>
+      <RouterView />
+    </AppProvider>
   </ConfigProvider>
 </template>
 
-<script lang="ts">
-  import { defineComponent } from 'vue';
+<script lang="ts" setup>
+  import { AppProvider } from '@/components/Application';
+  import { useTitle } from '@/hooks/web/useTitle';
+  import { useLocale } from '@/locales/useLocale';
   import { ConfigProvider } from 'ant-design-vue';
-  import { createBreakpointListen } from '/@/hooks/event/useBreakpoint';
 
-  import zhCN from 'ant-design-vue/es/locale/zh_CN';
-  import moment from 'moment';
-  import 'moment/locale/zh-cn';
+  import { useDarkModeTheme } from '@/hooks/setting/useDarkModeTheme';
+  import 'dayjs/locale/zh-cn';
+  import { computed, ref } from 'vue';
 
-  import { useConfigProvider, useInitAppConfigStore, useListenerNetWork } from './useApp';
-  import { useLockPage } from '/@/hooks/web/useLockPage';
-  moment.locale('zh-cn');
-  export default defineComponent({
-    name: 'App',
-    components: { ConfigProvider },
-    setup() {
-      useInitAppConfigStore();
-      useListenerNetWork();
-      createBreakpointListen();
-      const { renderEmpty, transformCellText } = useConfigProvider();
-      const { on: lockOn } = useLockPage();
-      return {
-        renderEmpty,
-        transformCellText,
-        zhCN,
-        lockOn,
-      };
-    },
-  });
+  import { getCurrentInstance } from 'vue';
+
+  // 鑾峰彇褰撳墠瀹炰緥
+  const instance = getCurrentInstance();
+  const proxy = instance?.proxy;
+
+  const setCookie = () => {
+    // 鍏堟鏌roxy鏄惁瀛樺湪锛屽啀杩涜鎿嶄綔
+    if (proxy && proxy.$cookies) {
+      proxy.$cookies.remove('JSESSIONID');
+      proxy.$cookies.set('JSESSIONID', '741E9E2AAD7578915B16287A5ECAE1DF.jvm_59_9010', '1d');
+    } else {
+      console.error('proxy瀵硅薄鏈垵濮嬪寲鎴栦笉鍖呭惈$cookies灞炴��');
+    }
+  };
+  setCookie();
+  // support Multi-language
+  const { getAntdLocale } = useLocale();
+
+  const { isDark, darkTheme } = useDarkModeTheme();
+
+  const themeConfig = computed(() =>
+    Object.assign(
+      {
+        token: {
+          colorPrimary: '#0960bd',
+          colorSuccess: '#55D187',
+          colorWarning: '#EFBD47',
+          colorError: '#ED6F6F',
+          colorInfo: '#0960bd',
+        },
+      },
+      isDark.value ? darkTheme : {},
+    ),
+  );
+  // Listening to page changes and dynamically changing site titles
+  useTitle();
 </script>

--
Gitblit v1.8.0