소스 검색

系统logo支持配置

hbchen 11 달 전
부모
커밋
a6a9784119
4개의 변경된 파일41개의 추가작업 그리고 2개의 파일을 삭제
  1. 7 0
      src/api/user.js
  2. 11 1
      src/views/Login.vue
  3. 14 0
      src/views/tabbar/Home.vue
  4. 9 1
      src/views/tabbar/User.vue

+ 7 - 0
src/api/user.js

@@ -105,6 +105,13 @@ export const _apiLogin = {
     getICPLicense:(params)=>{
         return get('/user_login/icp_license',params)
     },
+    /**
+     * 获取配置信息
+     * @returns 
+    */
+    getBaseInfo:(params)=>{
+        return get('/user_login/base_info',params)
+    },
 }
 
 

+ 11 - 1
src/views/Login.vue

@@ -148,8 +148,18 @@ function getRecordInfo(){
     })
 
 }
+const logo=ref('')
+function getBaseInfo(){
+    _apiLogin.getBaseInfo().then(res=>{
+        if(res.Ret == 200){
+            logo.value=res.Data.LogoMobile?res.Data.LogoMobile.ConfVal:''
+        }
+    })
+}
 
 getRecordInfo();//获取备案信息
+getBaseInfo()//获取基础信息
+
 </script>
 
 <template>
@@ -157,7 +167,7 @@ getRecordInfo();//获取备案信息
         <div class="login-page">
             <van-form class="form-box" ref="loginForm" v-if="activeModel!=='forgetPassModel'">
                 <div class="logo-wrap">
-                    <img class="logo" src="@/assets/imgs/logo_icon.png" alt="">
+                    <img class="logo" :src="logo" alt="">
                     <div class="title">Bind on account,</div>
                     <div class="sub-title">sign in to continue</div>
                 </div>

+ 14 - 0
src/views/tabbar/Home.vue

@@ -6,6 +6,10 @@ import {getStaticImg} from '@/hooks/common'
 import {useCachedViewsStore} from '@/store/modules/cachedViews'
 import { showToast } from 'vant';
 import { useWindowSize } from '@vueuse/core'
+import {usePublicSettingStore} from '@/store/modules/publicSetting'
+import {_apiLogin} from '@/api/user'
+const publicSettingStore = usePublicSettingStore()
+
 
 const { width } = useWindowSize()
 const cachedViewsStore=useCachedViewsStore()
@@ -209,7 +213,17 @@ async function getMenuList(){
         resMenuList.value=res.Data.List||[]
     }
 }
+
+const getSetTitle=()=>{
+    _apiLogin.getBaseInfo().then(res=>{
+        if(res.Ret == 200){
+            document.title=res.Data.TabNameMobile?res.Data.TabNameMobile.ConfVal:''
+        }
+    })
+}
+
 getMenuList()
+getSetTitle()
 
 </script>
 

+ 9 - 1
src/views/tabbar/User.vue

@@ -3,7 +3,7 @@ import {Base64} from 'js-base64'
 import  {ref} from 'vue'
 import { useRouter } from 'vue-router'
 import {useUserInfo} from '@/hooks/common'
-
+import {_apiLogin} from '@/api/user'
 const router=useRouter()
 
 let userInfo=useUserInfo()
@@ -13,7 +13,15 @@ function handleLoginOut(){
     localStorage.removeItem('userInfo')
     router.replace('/login')
 }
+const getSetTitle=()=>{
+    _apiLogin.getBaseInfo().then(res=>{
+        if(res.Ret == 200){
+            document.title=res.Data.TabNameMobile?res.Data.TabNameMobile.ConfVal:''
+        }
+    })
+}
 
+getSetTitle()
 </script>
 
 <template>