ZaiZai 2 rokov pred
rodič
commit
0a32b9c65b
3 zmenil súbory, kde vykonal 13 pridanie a 8 odobranie
  1. 4 5
      src/layout/index.vue
  2. 8 2
      src/store/index.js
  3. 1 1
      src/views/login/index.vue

+ 4 - 5
src/layout/index.vue

@@ -3,11 +3,8 @@
         <el-aside :class="[isCollapse?'is-collapse':'']" :width="isCollapse?'90px':'250px'"
                   class="hc-aside-box">
             <div class="hc-aside-logo-box" @click="logoClick">
-                <template v-if="appLogoIcon">
-                    <img :src="appLogoIcon" alt="" id="logo-icon">
-                    <img :src="appLogoName" alt="" id="logo-name" v-if="!isCollapse">
-                </template>
-                <div id="logo-icon" v-else></div>
+                <img :src="logoIcon" alt="" id="logo-icon">
+                <img :src="logoName" alt="" id="logo-name" v-if="!isCollapse">
             </div>
             <div class="hc-aside-menu-box">
                 <el-scrollbar>
@@ -66,6 +63,8 @@ import HelpInfoBar from "./modules/HelpInfoBar.vue"
 import UserInfoBar from "./modules/UserInfoBar.vue"
 import ConfigBar from "./modules/ConfigBar.vue"
 import TopMenuBar from "./modules/TopMenuBar.vue"
+import logoIcon from "~src/assets/logo/icon.png";
+import logoName from "~src/assets/logo/name.png";
 import {initButtons, initProjectContract} from "~sto/app";
 import website from '~src/config/index'
 import {setImageColorStyle} from "js-fast-way";

+ 8 - 2
src/store/index.js

@@ -10,8 +10,8 @@ export const useAppStore = defineStore('main', {
     state: () => ({
         //系统信息
         title: getStoreValue('title') || appConfig.title,
-        logoIcon: getStoreValue('logoIcon') || logoIcon,
-        logoName: getStoreValue('logoName') || logoName,
+        logoIcon: logoIcon,
+        logoName: logoName,
         //主题信息
         theme: getStoreValue('theme') || appConfig.theme,    //用户可选择类型:auto,light, dark
         themeVal: getStoreValue('themeVal') || '',           //实际主题:light, dark
@@ -52,6 +52,7 @@ export const useAppStore = defineStore('main', {
         //菜单信息
         getMenus: state => state.menus,
         getButtons: state => state.buttons,
+        getHomeUrl: state => state.homeUrl,
         //项目合同段数据
         getProjectContract: state => state.projectContract,
         getProjectInfo: state => state.projectInfo,
@@ -120,6 +121,10 @@ export const useAppStore = defineStore('main', {
         getButtonsVal(value) {
             return this.buttons[value] || false;
         },
+        setHomeUrl(value) {
+            this.homeUrl = value
+            setStoreValue('homeUrl', value)
+        },
         //项目合同段数据
         setProjectContract(value) {
             this.projectContract = value
@@ -162,6 +167,7 @@ export const useAppStore = defineStore('main', {
             this.userInfo = null
             this.menus = null
             this.buttons = null
+            this.homeUrl = null
             this.projectContract = null
             this.projectInfo = null
             this.contractInfo = null

+ 1 - 1
src/views/login/index.vue

@@ -94,7 +94,7 @@ const setHomeRouter = () => {
     if (routes.indexOf(appHomeUrl) === -1) {
         appHomeUrl = routes[routes.length - 1]
     }
-    userStore.homeUrl = appHomeUrl
+    userStore.setHomeUrl(appHomeUrl)
     router.push({
         name: appHomeUrl
     });