signalR提示优化

This commit is contained in:
不做码农
2023-05-16 12:18:24 +08:00
parent dd07ed78cc
commit bdd774dcd4
+6 -5
View File
@@ -27,16 +27,17 @@ export default {
}) })
connection.onreconnected(() => { connection.onreconnected(() => {
ElMessage({
message: '与服务器通讯已连接成功',
type: 'success',
duration: 2000
})
console.log('断线重新连接成功') console.log('断线重新连接成功')
}) })
connection.onreconnecting(async () => { connection.onreconnecting(async () => {
console.log('断线重新连接中... ') console.log('断线重新连接中... ')
ElMessage({
message: '与服务器通讯断开连接了,请稍后刷新浏览器尝试',
type: 'warning',
duration: 3000
})
await this.start() await this.start()
}) })