fix
This commit is contained in:
@@ -88,6 +88,7 @@ axios.interceptors.response.use((res) =>{
|
||||
}
|
||||
}, function(error) {
|
||||
if(error?.response?.status === 401 && router.currentRoute._value.name != 'setIdentification'){//如果是记录浏览器页面就不跳转login
|
||||
clonAllCookie()
|
||||
if(!isLoginTime){
|
||||
isLoginTime = true
|
||||
let isSystemUserRouteList = ['/Square']//如果是这两个页面就无需跳转未登录页
|
||||
@@ -102,7 +103,6 @@ axios.interceptors.response.use((res) =>{
|
||||
router.replace('/')
|
||||
}
|
||||
message.warning('Please login and try again~')
|
||||
clonAllCookie()
|
||||
store.commit('clearSystemUser')
|
||||
setTimeout(()=>[
|
||||
isLoginTime = false
|
||||
|
||||
46
src/tool/webSocket.js
Normal file
46
src/tool/webSocket.js
Normal file
@@ -0,0 +1,46 @@
|
||||
class MyWs {
|
||||
constructor() {
|
||||
this.ws = null;
|
||||
// this.ws = new WebSocket();
|
||||
}
|
||||
linkWs(url) {
|
||||
if (this.ws && this.ws.readyState == 1) return
|
||||
this.ws = new WebSocket(url)
|
||||
}
|
||||
sendMessage(data) {
|
||||
console.log(this);
|
||||
if (this.ws && this.ws.readyState == 1) {
|
||||
let obj = {
|
||||
cmd: 1,
|
||||
data: {
|
||||
name: '123',
|
||||
}
|
||||
}
|
||||
this.send(obj)
|
||||
obj = {
|
||||
cmd: 4,
|
||||
data: {
|
||||
msg: data,
|
||||
}
|
||||
}
|
||||
this.send(obj)
|
||||
// obj = {
|
||||
// cmd: 6,
|
||||
// data: {
|
||||
// msg: data,
|
||||
// }
|
||||
// }
|
||||
// this.send(obj,this.ws)
|
||||
}
|
||||
}
|
||||
send(obj) {
|
||||
console.log(2323);
|
||||
this.ws.send(JSON.stringify(obj))
|
||||
}
|
||||
close(){
|
||||
if (this.ws && this.ws.readyState == 1) {
|
||||
this.ws.close()
|
||||
}
|
||||
}
|
||||
}
|
||||
export default new MyWs();
|
||||
Reference in New Issue
Block a user