Преглед на файлове

fix(App.vue): 修复云南项目主题颜色设置逻辑

修复了在路由路径不为 '/config/theme' 时,云南项目主题颜色设置逻辑错误的问题。原逻辑未考虑路由路径,导致在某些情况下主题颜色被错误设置。
duy преди 4 месеца
родител
ревизия
ac4c32a958
променени са 1 файла, в които са добавени 3 реда и са изтрити 3 реда
  1. 3 3
      src/App.vue

+ 3 - 3
src/App.vue

@@ -11,11 +11,11 @@ import { detectionBrowser, getAppVersion, useOsTheme } from 'hc-vue3-ui'
 import { getObjValue, setElementMainColor } from 'js-fast-way'
 import { addDocumentsJs } from '~uti/tools'
 import split from 'split.js'
-
+import { useRoute } from 'vue-router'
 //初始变量
 const appStore = useAppStore()
 const UserTheme = ref(appStore.getTheme)
-
+const useRoutes = useRoute()
 //监听
 watch(() => [
     appStore.getTheme,
@@ -42,7 +42,7 @@ const setUserTheme = (theme, appColor) => {
 
     const projectInfo = appStore.projectInfo
     const id = '1891312830718746625'
-    let isYunNan = projectInfo?.id === id
+    let isYunNan = useRoutes?.path !== '/config/theme' && projectInfo?.id === id
     if (isYunNan) {
         setElementMainColor('#409eff')
         let colorName = 'blue'