From f6ac203c915d7562aef51628a4ab3e601c3274f1 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期四, 03 八月 2023 19:11:53 +0800
Subject: [PATCH] 1.角色权限优化50%

---
 src/layout/components/Navbar.vue |   20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue
index 620839c..a9f42f4 100644
--- a/src/layout/components/Navbar.vue
+++ b/src/layout/components/Navbar.vue
@@ -172,6 +172,8 @@
 import RightPanel from '@/components/RightPanel'
 import Settings from '../components/Settings/index'
 import * as signalR from '@aspnet/signalr'
+import { ButtonData } from '@/api/basicSettings'
+import Vue from 'vue'
 
 export default {
   components: {
@@ -236,10 +238,12 @@
     // this.$signalr.start()
     this.usercode = getCookie('navTabId')
     this.username = getCookie('username')
-    this.stu_torgname = getCookie('stu_torgname') === '' ? '绯荤粺绠$悊鍛�' : getCookie('stu_torgname')
+    this.stu_torgname = getCookie('stu_torgname')
   },
   mounted() {
     // this.getHubConnectionBuilder()
+
+    this.getButtonData()
   },
   computed: {
     ...mapGetters([
@@ -271,6 +275,12 @@
     }
   },
   methods: {
+    // 鑾峰彇鍏ㄥ眬鎸夐挳閿�煎
+    async  getButtonData() {
+      const { data: res } = await ButtonData()
+      Vue.prototype.$ButtonData = res // 鐢ㄤ簬鍏ㄥ眬
+    },
+
     // 寤虹珛hub杩炴帴
     async getHubConnectionBuilder() {
       const url = 'http://121.196.36.24:8019/chatHub'
@@ -332,11 +342,11 @@
       this.$store.dispatch('app/toggleSideBar')
     },
     async logout() {
-      localStorage.removeItem('token')
-      await this.signalr.stop()
-      this.signalr.off('SendCustomUserMessage')
+      // await this.signalr.stop()
+      // this.signalr.off('SendCustomUserMessage')
       await this.$store.dispatch('user/logout')
-      this.$message.success('閫�鍑烘垚鍔燂紒')
+      localStorage.removeItem('token')
+      this.$notify.success('閫�鍑烘垚鍔燂紒')
       this.$router.push(`/login`)
     },
     editPassword() {

--
Gitblit v1.9.3