浏览代码

逻辑调整

princeLee 4 年之前
父节点
当前提交
57530909c3

+ 3 - 3
src/components/newLayout/Aside.vue

@@ -133,11 +133,11 @@ section {
 }
 .left-aside {
   width: 135px;
-  animation: 0.5s expande linear;
+  // animation: 0.5s expande linear;
 }
 .hidden-left-aside {
   width: 0;
-  animation: 0.5s close linear;
+  // animation: 0.5s close linear;
 }
 //左边导航栏样式
 .left-aside,
@@ -245,7 +245,7 @@ section {
   align-items: center;
   overflow: hidden;
   background-color: #ffffff;
-  animation: 0.5s topExpande linear;
+  // animation: 0.5s topExpande linear;
   border-bottom: 10px solid #F2F3F6;
   .business {
     position: absolute;

+ 1 - 0
src/components/newLayout/Head.vue

@@ -85,6 +85,7 @@ export default {
     // 设置二级导航类型
     setNavTagType(type) {
       this.$store.dispatch('global/setNavTagType', type)
+      localStorage.setItem('navTagType', type)
     },
     // 获取登录人员信息
     async getLoginUser() {

+ 1 - 1
src/store/modules/global.js

@@ -2,7 +2,7 @@
 const state = {
   activeNavTag: '个人工作台', // 当前导航对象
   showNavTag: true, // 是否显示2级导航栏
-  navTagType: 1, // 2级导航类型
+  navTagType: Number(localStorage.getItem('navTagType')) || 1, // 2级导航类型
   collapsed: false, // 侧边2级导航是否收起状态
   bizId: -1, // 业务线id
   bizName: '业务线' // 业务线名称

+ 3 - 0
src/utils/request.js

@@ -5,6 +5,7 @@ import { loginUrl } from '@/apiConfig/requestIP.js'
 import { Encrypt } from '@/utils/crypto-js.js'
 import { message } from '@/utils/mesDebounce'
 import router from '@/router/index.js'
+import store from '@/store/index.js'
 
 // create an axios instance
 const service = axios.create({
@@ -117,6 +118,8 @@ service.interceptors.response.use(
       if (error.response.status === 401) {
         location.href = loginUrl
       } else if (error.response.status === 403) {
+        store.dispatch('global/setBizId', -1)
+        store.dispatch('global/setBizName', '')
         router.push({ name: 'notAccess' })
       }
     } else {

+ 11 - 1
src/views/errorPages/notAccess.vue

@@ -11,10 +11,18 @@
   </section>
 </template>
 <script>
+import { mapGetters } from 'vuex'
 export default {
+  computed: {
+    ...mapGetters(['bizId', 'bizName'])
+  },
   methods: {
     linkTo(name) {
-      this.$router.push({ name: name })
+      if (name === '项目管理' && this.bizId === -1) {
+        this.$router.push({ name: '业务线选择' })
+      } else {
+        this.$router.push({ name: name })
+      }
     }
   }
 }
@@ -38,8 +46,10 @@ h3 {
   display: flex;
   flex-direction: column;
   color: #666666;
+  margin-left: 100px;
 }
 .button-link {
   margin-top: 20px;
+  margin-left: 100px;
 }
 </style>

+ 2 - 0
src/views/errorPages/notFound.vue

@@ -41,8 +41,10 @@ h3 {
   display: flex;
   flex-direction: column;
   color: #666666;
+  margin-left: 100px;
 }
 .button-link {
   margin-top: 20px;
+  margin-left: 100px;
 }
 </style>