From 91f291a2c3b4e41fc0b44f2395ad5c956803ee8c Mon Sep 17 00:00:00 2001
From: 廖井涛 <2265517004@qq.com>
Date: 星期六, 11 五月 2024 08:34:24 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override

---
 north-glass-erp/northglass-erp/src/layout/MainErpView.vue |   61 ++++++++++++++++++++++--------
 1 files changed, 45 insertions(+), 16 deletions(-)

diff --git a/north-glass-erp/northglass-erp/src/layout/MainErpView.vue b/north-glass-erp/northglass-erp/src/layout/MainErpView.vue
index 7072d2d..86a58c2 100644
--- a/north-glass-erp/northglass-erp/src/layout/MainErpView.vue
+++ b/north-glass-erp/northglass-erp/src/layout/MainErpView.vue
@@ -17,28 +17,58 @@
 const router = useRouter()
 const userStore = useUserInfoStore()
 const user = userStore.user.userName
+//鐩戝惉寮傛杩斿洖浠g爜
+watch(()=>userStore.responseCode,(newVal) => {
+    switch (newVal){
+      case 401:{
+        if(userStore.msg.split('.')[1] === 'search'){
+          router.push({path:'/main/user/notPermission'});
+        }else{
+          ElMessage.warning(t('error.Code_401'))
+        }
+        userStore.responseCode=null
+        break
+      }
+      case 402:{
+        ElMessage.warning(t('error.Code_402'))
+        router.push("/login")
+        break
+      }
+      default:{
+        break
+      }
+    }
+  }
+)
+
 store.createWebSocket();
+
+// 閫�鍑虹櫥褰�
 function quit(){
   userStore.$patch({
     user:null
   })
-  router.push("/login")
+  request.post('/userInfo/logout').finally(()=>{
+    router.push("/login")
+  })
+
+  //
 }
+
+
 
 
 //鎻愬彇妯″潡鍒楄〃
 let menuList=$ref([])
-request.get(`/menu/getMenu/${lang}`).then((res) => {
-  if(res.code==200){
-    menuList= deepClone(res.data)
-  }else{
-    ElMessage.warning(res.msg)
-    router.push("/login")
-  }
-}).catch((e)=>{
-  ElMessage.warning(t('main.connectErr'))
-  router.push("/login")
+onMounted(()=>{
+  request.get(`/menu/getMenu/${lang}`).then((res) => {
+    if(res.code==200){
+      menuList= deepClone(res.data)
+    }
+  })
+
 })
+
 
 //鑾峰彇鑿滃崟鍒楄〃
 let menuItemList=$ref([])
@@ -89,13 +119,12 @@
         <div style="height: 100%;width: 100%;display: flex">
           <img src="../assets/northGlass.ico" alt="" style="max-width: 100%;max-height: 100%">
           <h3 style="margin: 1rem  ;font-weight: bold;width: 40vw;"> {{$t('main.titleFirst') + user + $t('main.titleLast')}}</h3>
-          <span style="height: 70%;width: 78vw;margin-top: 1rem;" >
+          <span style="height: 70%;width: 78vw;margin-top: 1.5rem;" >
 
-            <el-button  class="sys-quit" @click="quit"  type="info" round>
-              <el-icon size="large"><SwitchButton  size=""/></el-icon>
-            </el-button>
+<!--            <el-button   class="sys-quit" @click="quit"  type="info" round>-->
+              <el-icon @click="quit"  style="float: right;margin-right: 1rem" size="large" ><SwitchButton  size=""/></el-icon>
+<!--            </el-button>-->
           </span>
-
         </div>
       </el-header>
       <el-container >

--
Gitblit v1.8.0