zhangsijie 1 anno fa
parent
commit
15d2b66055

+ 6 - 2
minggao/src/page/home/index.vue

@@ -24,7 +24,7 @@
           <i class="el-icon-message-solid" @click="towarn"></i>
           <p class="dian" v-if="warntf"></p>
         </div>
-        <div title="去大屏">
+        <div title="去大屏" v-if="hasNewHome">
           <router-link target="_blank" style="margin-right: 15px; font-size: 22px; color: #666666" to="/newHome/home"><i class="el-icon-monitor"></i></router-link>
         </div>
         <div
@@ -202,6 +202,7 @@ export default {
       }
     };
     return {
+      hasNewHome:false,
       infodata: [],
       username: '',
       routerdata: [],
@@ -306,10 +307,13 @@ export default {
         this.routerdata = JSON.parse(JSON.stringify(res.data.data.children));
         var titleList = [];
         res.data.data.children.forEach(item => {
-          if (item.purview_name !== 'APP') {
+          if (item.purview_name !== 'APP' && item.pur_id != 62) {
             titleList.push(item);
           }
         });
+        this.hasNewHome = res.data.data.children.some(item => {
+          return item.pur_id == 62
+        })
         // this.infodata = res.data.data.children;
         this.infodata = titleList;
         console.log(

+ 4 - 3
minggao/src/page/home/newHome/index.vue

@@ -3,7 +3,7 @@
  * @Autor: lin
  * @Date: 2024-04-09 14:29:42
  * @LastEditors: lin
- * @LastEditTime: 2024-04-30 08:35:41
+ * @LastEditTime: 2024-05-06 18:17:20
 -->
 <template>
   <div class="bigBox">
@@ -22,7 +22,7 @@
       <router-link to="/index/taskRegulator" target="_blank">
         <div class="newHomeBtn">下发任务</div>
       </router-link>
-      <router-link to="/index/facilitydistribute"  target="_blank">
+      <router-link :to="defaultRouter"  target="_blank">
         <div :class="`newHomeBtn`">管理后台
         </div>
       </router-link>
@@ -51,7 +51,8 @@ export default {
   data() {
     return {
       currentTime: '',
-      timmer: null
+      timmer: null,
+      defaultRouter: localStorage.getItem('defaultRouter')
     };
   },
   computed: {

+ 23 - 1
minggao/src/page/login/login.vue

@@ -99,8 +99,30 @@ export default {
             // console.log(res);
             if (res.data.data) {
               localStorage.setItem("session", res.data.data.session_key);
+              this.$axios({
+                method: 'POST',
+                url: '/api/api_gateway?method=sysmenage.usermanager.user_info'
+              }).then(res => {
+                let routerdata = JSON.parse(JSON.stringify(res.data.data.children));
+                console.log(routerdata);
+                let defaultRouter = '';
+                if(routerdata.length > 0) {
+                  if(routerdata[0].children && routerdata[0].children.length > 0) {
+                    this.$router.push(`/index/${routerdata[0].children[0].menu}`);
+                    defaultRouter = `/index/${routerdata[0].children[0].menu}`;
+                  } else {
+                    this.$router.push(routerdata[0].menu);
+                    defaultRouter = `/index/${routerdata[1].children[0].menu}`; // 第一个菜单无子元素则取第二个菜单的第一个子元素
+                  }
+                  localStorage.setItem("defaultRouter", defaultRouter);
+                } else {
+                  this.$message.error('当前账号无菜单权限,请检查账号信息或联系管理员')
+                }
+              })
+
               // this.$router.push("/Index/facilitydistribute");
-              this.$router.push("/newHome/home");
+              // this.$router.push("/newHome/home");
+
             }
           });
         } else {