dedsudiyu %!s(int64=2) %!d(string=hai) anos
pai
achega
e28a3966c5
Modificáronse 5 ficheiros con 68 adicións e 62 borrados
  1. 6 3
      src/README.md
  2. 4 3
      src/layout/components/Navbar.vue
  3. 1 0
      src/permission.js
  4. 1 1
      src/router/index.js
  5. 56 55
      src/views/loginOne.vue

+ 6 - 3
src/README.md

@@ -14,7 +14,8 @@ views
         indexOne.vue
         performEvacuationOne.vue
   emergencyEvacuationBigOne.vue(本地静态路由需要同步修改)
-        
+  
+  *  项目名称修改 => 实验室安全智能监测与控制系统
         
         
         
@@ -36,6 +37,8 @@ views
   mine
     indexOne.vue
   loginOne.vue(本地静态路由需要同步修改)
-  项目名称修改--危化品智能存储管理系统
+  
+  *  项目名称修改 => 危化品智能存储管理系统
+  
+  *  按钮首页注释掉  layout => components => Navbar.vue
 
-# 部分牵扯前端页面跳转写死部分

+ 4 - 3
src/layout/components/Navbar.vue

@@ -13,9 +13,10 @@
       <div @click="goPage('message')">
         <img src="@/assets/ZDimages/top_nav_icon_02.png">
       </div>
-      <div @click="goPage('home')" v-if="userType!='22'&&initPage== 'true'">
-        <img src="@/assets/ZDimages/top_nav_icon_01.png">
-      </div>
+      <!--按钮首页-->
+      <!--<div @click="goPage('home')" v-if="userType!='22'&&initPage== 'true'">-->
+        <!--<img src="@/assets/ZDimages/top_nav_icon_01.png">-->
+      <!--</div>-->
     </div>
     <div class="right-menu">
       <!--<template v-if="device!=='mobile'">-->

+ 1 - 0
src/permission.js

@@ -22,6 +22,7 @@ router.beforeEach((to, from, next) => {
         // 判断当前用户是否已拉取完user_info信息
         store.dispatch('GetInfo').then(() => {
           store.dispatch('GenerateRoutes').then(accessRoutes => {
+            console.log('to',to);
             // 根据roles权限生成可访问的路由表
             router.addRoutes(accessRoutes) // 动态添加可访问路由表
             next({ ...to, replace: true }) // hack方法 确保addRoutes已完成

+ 1 - 1
src/router/index.js

@@ -29,7 +29,7 @@ import Layout from '@/layout'
 export const constantRoutes = [
   {
     path: '/',
-    component: (resolve) => require(['@/views/home'], resolve),
+    component: (resolve) => require(['@/layout/index'], resolve),
     hidden: true
   },
   {

+ 56 - 55
src/views/loginOne.vue

@@ -98,7 +98,7 @@
   import { encrypt, decrypt } from '@/utils/jsencrypt'
   import store from '@/store'
   import { getCodeImg,initPage,sendCode,phoneLogin } from "@/api/login";
-  // import { getRouters } from "@/api/menu";
+  import { getRouters } from "@/api/menu";
   import { getLogoInfo } from "@/api/system/publicConfig";
     export default {
       name: "login",
@@ -297,43 +297,43 @@
                     localStorage.setItem('identity',res.data.screen_token);
                     localStorage.setItem('identityType',res.data.screen_type);
                   }
-                  // this.getRouters().then(response => {
-                  //   console.log("responseresponseresponseresponse",response)
-                  // });
                   this.fullScreen();
                   if(res.data.type == 22){
-                    this.$router.push({ path: this.redirect || "/comprehensive/system/mine" }).catch(()=>{});
-                    // let routeData = JSON.parse(localStorage.getItem("routeData"))
-                    // for(let i=0;i<routeData.length;i++){
-                    //   if (routeData[i].children&&!routeData[i].hidden&&routeData[i].alwaysShow){
-                    //     for(let o=0;o<routeData[i].children.length;o++){
-                    //       if(!routeData[i].children[o].alwaysShow&&!routeData[i].children[o].hidden){
-                    //         let urlText = routeData[i].path + '/' + routeData[i].children[o].path;
-                    //         this.$router.push({ path: urlText });
-                    //         console.log("urlText2",urlText)
-                    //         return
-                    //       }else{
-                    //         if(routeData[i].children[o].children){
-                    //           for(let x=0;x<routeData[i].children[o].children.length;x++){
-                    //             if(!routeData[i].children[o].children[x].alwaysShow&&!routeData[i].children[o].children[x].hidden){
-                    //               let urlText = routeData[i].path + '/' + routeData[i].children[o].path + '/' + routeData[i].children[o].children[x].path;
-                    //               this.$router.push({ path: urlText });
-                    //               console.log("urlText3",urlText)
-                    //               return
-                    //             }
-                    //           }
-                    //         }
-                    //       }
-                    //     }
-                    //   }
-                    // }
+                    getRouters().then(response => {
+                      // let routeData = JSON.parse(localStorage.getItem("routeData"))
+                      let routeData = response.data;
+                      for(let i=0;i<routeData.length;i++){
+                        if (routeData[i].children&&!routeData[i].hidden&&routeData[i].alwaysShow){
+                          for(let o=0;o<routeData[i].children.length;o++){
+                            if(!routeData[i].children[o].alwaysShow&&!routeData[i].children[o].hidden){
+                              let urlText = routeData[i].path + '/' + routeData[i].children[o].path;
+                              this.$router.push({ path: this.redirect || urlText }).catch(()=>{});
+                              return
+                            }else{
+                              if(routeData[i].children[o].children){
+                                for(let x=0;x<routeData[i].children[o].children.length;x++){
+                                  if(!routeData[i].children[o].children[x].alwaysShow&&!routeData[i].children[o].children[x].hidden){
+                                    let urlText = routeData[i].path + '/' + routeData[i].children[o].path + '/' + routeData[i].children[o].children[x].path;
+                                    this.$router.push({ path: this.redirect || urlText }).catch(()=>{});
+                                    return
+                                  }
+                                }
+                              }
+                            }
+                          }
+                        }
+                      }
+                    });
                   } else {
+                    console.log('1');
+                    this.loading = false;
+                    // this.$router.push({ path: this.redirect || "/chemicalLibrary/medicUniversityHome" }).catch(()=>{});
                     this.$router.push({ path: this.redirect || "/chemicalLibrary/medicUniversityHome" }).catch(()=>{});
                   }
                 }).catch(() => {
                   this.loading = false;
                   if (this.captchaOnOff) {
-                    this.getCode();
+                    this.getCodeOne();
                   }
                 });
               }
@@ -368,31 +368,32 @@
                     }
                     this.fullScreen();
                     if(res.data.type == 22){
-                      this.$router.push({ path: this.redirect || "/comprehensive/system/mine" }).catch(()=>{});
-                      // let routeData = JSON.parse(localStorage.getItem("routeData"))
-                      // for(let i=0;i<routeData.length;i++){
-                      //   if (routeData[i].children&&!routeData[i].hidden&&routeData[i].alwaysShow){
-                      //     for(let o=0;o<routeData[i].children.length;o++){
-                      //       if(!routeData[i].children[o].alwaysShow&&!routeData[i].children[o].hidden){
-                      //         let urlText = routeData[i].path + '/' + routeData[i].children[o].path;
-                      //         this.$router.push({ path: urlText });
-                      //         console.log("urlText2",urlText)
-                      //         return
-                      //       }else{
-                      //         if(routeData[i].children[o].children){
-                      //           for(let x=0;x<routeData[i].children[o].children.length;x++){
-                      //             if(!routeData[i].children[o].children[x].alwaysShow&&!routeData[i].children[o].children[x].hidden){
-                      //               let urlText = routeData[i].path + '/' + routeData[i].children[o].path + '/' + routeData[i].children[o].children[x].path;
-                      //               this.$router.push({ path: urlText });
-                      //               console.log("urlText3",urlText)
-                      //               return
-                      //             }
-                      //           }
-                      //         }
-                      //       }
-                      //     }
-                      //   }
-                      // }
+                      // this.$router.push({ path: this.redirect || "/comprehensive/system/mine" }).catch(()=>{});
+                      getRouters().then(response => {
+                        // let routeData = JSON.parse(localStorage.getItem("routeData"))
+                        let routeData = response.data;
+                        for(let i=0;i<routeData.length;i++){
+                          if (routeData[i].children&&!routeData[i].hidden&&routeData[i].alwaysShow){
+                            for(let o=0;o<routeData[i].children.length;o++){
+                              if(!routeData[i].children[o].alwaysShow&&!routeData[i].children[o].hidden){
+                                let urlText = routeData[i].path + '/' + routeData[i].children[o].path;
+                                this.$router.push({ path: this.redirect || urlText }).catch(()=>{});
+                                return
+                              }else{
+                                if(routeData[i].children[o].children){
+                                  for(let x=0;x<routeData[i].children[o].children.length;x++){
+                                    if(!routeData[i].children[o].children[x].alwaysShow&&!routeData[i].children[o].children[x].hidden){
+                                      let urlText = routeData[i].path + '/' + routeData[i].children[o].path + '/' + routeData[i].children[o].children[x].path;
+                                      this.$router.push({ path: this.redirect || urlText }).catch(()=>{});
+                                      return
+                                    }
+                                  }
+                                }
+                              }
+                            }
+                          }
+                        }
+                      });
                     } else {
                       this.$router.push({ path: this.redirect || "/chemicalLibrary/medicUniversityHome" }).catch(()=>{});
                     }