Selaa lähdekoodia

feat(login): 支持动态显示项目名称

登录页标题根据配置动态展示项目名称,未配置时回退为默认名称。
yusheng 1 viikko sitten
vanhempi
commit
9a0b09a62f
1 muutettua tiedostoa jossa 9 lisäystä ja 2 poistoa
  1. 9 2
      src/views/login/index.vue

+ 9 - 2
src/views/login/index.vue

@@ -29,7 +29,7 @@
           <!-- 标题 -->
           <div class="form-header">
             <h1 class="form-title">
-              <span class="title-dark">工业互联网</span><span class="title-light">平台</span>
+              <span class="title-dark">{{projectName||'工业互联网平台'}}</span>
             </h1>
           </div>
 
@@ -116,7 +116,7 @@
   import {
     login,
     getCaptcha,
-    getLatestVersion,
+    getLatestVersion,logoByCode,
     getParentIdListByDeptId
   } from '@/api/login';
   import xyy from '@/assets/xyy.jpg';
@@ -134,6 +134,7 @@
         // 登录框方向, 0居中, 1居右, 2居左
         xyy,
         direction: 0,
+        projectName:"",
         // 加载状态
         loading: false,
         // 表单数据
@@ -192,6 +193,7 @@
     created() {
       this.changeCaptcha();
       this.generateQRCode();
+      this.getLogo();
       if (getToken()) {
         this.goHome();
       } else {
@@ -200,6 +202,11 @@
       }
     },
     methods: {
+       getLogo() {
+        logoByCode('logoCode').then((res) => {
+          this.projectName = res.logoName;
+        });
+      },
       generateQRCode() {
         getLatestVersion().then((res) => {
           console.log(res, 'dasdasd');