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 | 47 ++++++++++++++++++++++++++++-------------------
1 files changed, 28 insertions(+), 19 deletions(-)
diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue
index 139b2aa..e2209fd 100644
--- a/src/layout/components/Navbar.vue
+++ b/src/layout/components/Navbar.vue
@@ -268,7 +268,7 @@
// Vue.prototype.$ButtonData = JSON.parse(localStorage.getItem('ButtonData'))
},
mounted() {
- this.getHubConnectionBuilder()
+ // this.getHubConnectionBuilder()
},
computed: {
...mapGetters([
@@ -313,27 +313,36 @@
// 寤虹珛hub杩炴帴
async getHubConnectionBuilder() {
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')
@@ -341,7 +350,7 @@
this.$notify({ offset: 80, type: 'warning', title: '娑堟伅鎻愰啋', message: res })
this.$store.state.settings.isDot = true
})
- await this.signalr.invoke('AddUser', localStorage.getItem('account'))
+ await this.signalr.invoke('AddUser', localStorage.getItem('usercode'))
},
systemSetting() {
--
Gitblit v1.9.3