|
@@ -190,34 +190,6 @@ export default {
|
|
"class",
|
|
"class",
|
|
themeName === "dark" || themeName === "light" ? themeName : "dark"
|
|
themeName === "dark" || themeName === "light" ? themeName : "dark"
|
|
);
|
|
);
|
|
- console.log("离开标记", this.socketLeaveFlag);
|
|
|
|
- // that.$nextTick(() => {
|
|
|
|
- // that.API.requestData({
|
|
|
|
- // isMust: false, // 请求是否携带 token ,默认为 true ,可缺省
|
|
|
|
- // method: "POST", // 请求方式,默认为 GET ,可缺省
|
|
|
|
- // subUrl: "admin/loginvue", // 请求接口地址,必传项
|
|
|
|
- // data: {
|
|
|
|
- // username: "admin",
|
|
|
|
- // password: "admin",
|
|
|
|
- // },
|
|
|
|
- // success(res) {
|
|
|
|
- // localStorage.setItem("authToken", res.data.authToken);
|
|
|
|
- // localStorage.setItem("username", res.data.user.laborName);
|
|
|
|
-
|
|
|
|
- // that.API.requestData({
|
|
|
|
- // method: "POST", // 请求方式,默认为 GET ,可缺省
|
|
|
|
- // subUrl: "admin/usermenu", // 请求接口地址,必传项
|
|
|
|
- // success() {
|
|
|
|
- // // that.BASE.showMsg({
|
|
|
|
- // // msg: "登陆成功",
|
|
|
|
- // // type: "success",
|
|
|
|
- // // });
|
|
|
|
- // // that.$router.push('/'); // 跳转到首页
|
|
|
|
- // },
|
|
|
|
- // });
|
|
|
|
- // },
|
|
|
|
- // });
|
|
|
|
- // });
|
|
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
let that = this;
|
|
let that = this;
|
|
@@ -290,7 +262,6 @@ export default {
|
|
createWebSocket() {
|
|
createWebSocket() {
|
|
// let webSocketLink = `ws://192.168.1.102:6014/websocketBt/${this.$store.state.user.userId}_${this.$store.state.user.authToken}`;
|
|
// let webSocketLink = `ws://192.168.1.102:6014/websocketBt/${this.$store.state.user.userId}_${this.$store.state.user.authToken}`;
|
|
let webSocketLink = `ws://10.81.3.154:6014/websocketBt/${this.$store.state.user.userId}_${this.$store.state.user.authToken}`; // webSocket地址
|
|
let webSocketLink = `ws://10.81.3.154:6014/websocketBt/${this.$store.state.user.userId}_${this.$store.state.user.authToken}`; // webSocket地址
|
|
- // console.log(webSocketLink);
|
|
|
|
try {
|
|
try {
|
|
if ("WebSocket" in window) {
|
|
if ("WebSocket" in window) {
|
|
this.socketObj = new WebSocket(webSocketLink);
|
|
this.socketObj = new WebSocket(webSocketLink);
|
|
@@ -364,8 +335,6 @@ export default {
|
|
},
|
|
},
|
|
// 接收到消息的回调
|
|
// 接收到消息的回调
|
|
getMessageCallback: function (msg) {
|
|
getMessageCallback: function (msg) {
|
|
- // console.log(msg);
|
|
|
|
- console.log(msg);
|
|
|
|
if (Object.keys(msg) && msg.data == "ok") {
|
|
if (Object.keys(msg) && msg.data == "ok") {
|
|
// 心跳回复——心跳检测重置
|
|
// 心跳回复——心跳检测重置
|
|
// 收到心跳检测回复就说明连接正常
|
|
// 收到心跳检测回复就说明连接正常
|