Przeglądaj źródła

fix: logo配置

lxz 2 lat temu
rodzic
commit
725604c2f1
1 zmienionych plików z 13 dodań i 9 usunięć
  1. 13 9
      src/components/Application/src/AppLogo.vue

+ 13 - 9
src/components/Application/src/AppLogo.vue

@@ -20,8 +20,8 @@
   import { useUserStore } from '/@/store/modules/user';
   import { useAppStore } from '/@/store/modules/app';
 
-  import logoSvg from '/@/assets/svg/logo.svg';
-  import logoWhiteSvg from '/@/assets/svg/logo-white.svg';
+  // import logoSvg from '/@/assets/svg/logo.svg';
+  // import logoWhiteSvg from '/@/assets/svg/logo-white.svg';
 
   const props = defineProps({
     /**
@@ -43,12 +43,12 @@
   const userStore = useUserStore();
   const { title } = useGlobSetting();
   const go = useGo();
-
+  import { sysSettingDetail } from '/@/api/sys/sysSettingApi';
   const appStore = useAppStore();
 
-  const showLogo = ref(logoSvg);
-
-  onMounted(() => {
+  // const showLogo = ref(logoSvg);
+  const showLogo = ref('');
+  onMounted(async () => {
     const bgColor = appStore.getMenuSetting.bgColor;
     setBgColor(bgColor);
   });
@@ -73,11 +73,15 @@
     },
   ]);
 
-  function setBgColor(val) {
+  async function setBgColor(val) {
     if (val == '#ffffff') {
-      showLogo.value = logoSvg;
+      // showLogo.value = logoSvg;
+      const res = await sysSettingDetail();
+      showLogo.value = res.logo;
     } else {
-      showLogo.value = logoWhiteSvg;
+      // showLogo.value = logoWhiteSvg;
+      const res = await sysSettingDetail();
+      showLogo.value = res.logo;
     }
   }