This commit is contained in:
X1627315083
2024-08-13 09:36:13 +08:00
parent 1f5ddc604a
commit a0c3b06b80
23 changed files with 23125 additions and 22325 deletions

View File

@@ -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
View 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();