From df418a35e80167ae120e5840d6ff8d19676ee399 Mon Sep 17 00:00:00 2001
From: 小小儁爺 <1694218219@qq.com>
Date: 星期五, 15 五月 2026 13:37:09 +0800
Subject: [PATCH] 1.报告记录删除功能

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

diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue
index 3b02761..e2209fd 100644
--- a/src/layout/components/Navbar.vue
+++ b/src/layout/components/Navbar.vue
@@ -269,7 +269,6 @@
   },
   mounted() {
     // this.getHubConnectionBuilder()
-
   },
   computed: {
     ...mapGetters([
@@ -313,28 +312,37 @@
     // },
     // 寤虹珛hub杩炴帴
     async getHubConnectionBuilder() {
-      const url = 'http://121.196.36.24:8019/chatHub'
+      const url = 'http://121.196.36.24:8048/chatHub'
+
+      // 鏈湴寮�鍙�
+      // if (process.env.NODE_ENV === 'development') {
+      //   url = 'http://121.196.36.24:8048/chatHub'
+      // } else { // 鐢熶骇鐜锛堝叧閿紒锛侊紒鐢ㄧ浉瀵硅矾寰勶紝閬垮厤璺ㄥ煙/鍗忚閿欒锛�
+      //   url = '/chatHub'
+      // }
+
       this.signalr = new signalR.HubConnectionBuilder().withUrl(url, {
-        // skipNegotiation: true,
-        // transport: signalR.HttpTransportType.WebSockets
+        withCredentials: false, // 璺ㄥ煙闇�瑕�
+        skipNegotiation: true,
+        transport: signalR.HttpTransportType.WebSockets
       }).configureLogging(signalR.LogLevel.Information).build()
 
       await this.signalr.start().then(() => {
-        if (window.Notification) {
-          if (Notification.permission === 'granted') {
-            console.log('鍏佽閫氱煡')
-          } else if (Notification.permission !== 'denied') {
-            console.log('闇�瑕侀�氱煡鏉冮檺')
-            Notification.requestPermission((permission) => {
-              console.log('鏉冮檺閫氱煡', permission)
-            })
-          } else if (Notification.permission === 'denied') {
-            // console.log('鎷掔粷閫氱煡')
-          }
-        } else {
-          console.error('娴忚鍣ㄤ笉鏀寔Notification')
-        }
-        // console.log('杩炴帴鎴愬姛')
+        // if (window.Notification) {
+        //   if (Notification.permission === 'granted') {
+        //     console.log('鍏佽閫氱煡')
+        //   } else if (Notification.permission !== 'denied') {
+        //     console.log('闇�瑕侀�氱煡鏉冮檺')
+        //     Notification.requestPermission((permission) => {
+        //       console.log('鏉冮檺閫氱煡', permission)
+        //     })
+        //   } else if (Notification.permission === 'denied') {
+        //     console.log('鎷掔粷閫氱煡')
+        //   }
+        // } else {
+        //   console.error('娴忚鍣ㄤ笉鏀寔Notification')
+        // }
+        console.log('杩炴帴鎴愬姛')
       })
 
       this.signalr.off('SendCustomUserMessage')
@@ -342,7 +350,7 @@
         this.$notify({ offset: 80, type: 'warning', title: '娑堟伅鎻愰啋', message: res })
         this.$store.state.settings.isDot = true
       })
-      await this.signalr.invoke('AddUser', getCookie('admin'))
+      await this.signalr.invoke('AddUser', localStorage.getItem('usercode'))
     },
 
     systemSetting() {

--
Gitblit v1.9.3