Commit 91f4a8d2 authored by zhanglw's avatar zhanglw

修复退出异常

parent 61ffaa92
// 项目配置相关
const config = {
//ganxu
BASE_URL: 'http://192.168.3.23:9092',
REAL_URL: 'http://192.168.3.23:9092',
ws: '8.143.203.103:9092',
// BASE_URL: 'http://192.168.3.23:9092',
// REAL_URL: 'http://192.168.3.23:9092',
// ws: '8.143.203.103:9092',
//服务器
// BASE_URL: 'http://8.143.203.103:9092',
// REAL_URL: 'http://8.143.203.103:9092',
// BASE_URL: 'http://39.164.225.220:5000',
// REAL_URL: 'http://39.164.225.220:5000',
// ws: '39.164.225.220:5000',
BASE_URL: 'http://39.164.225.220:5000',
REAL_URL: 'http://39.164.225.220:5000',
ws: '39.164.225.220:5000',
TOKEN_KEY: 'token',
USER_KEY: 'userInfo',
......
......@@ -56,8 +56,8 @@ export default {
data() {
return {
loginForm: {
username: "",
password: "",
username: "testkc",
password: "123456",
uuid: "",
},
loading: false,
......@@ -65,7 +65,8 @@ export default {
keyboardShowType: "",
//设备OAID testkc test999
//testcc deviceOAID: "test888",
deviceOAID: "",
// deviceOAID: "test999",
deviceOAID: "140945db5f9b8e04",
//判断设备是否与车绑定
bindingStatus: false,
//绑定的车牌号
......@@ -79,18 +80,17 @@ export default {
this.getCookie();
},
mounted() {
console.log(window, 1111111);
//两种方法相互冲突,每次只需要一种,并且获取的id不一样
//app获取设备号方法
this.appGetDeviceId();
// this.appGetDeviceId();
//5+app获取OAID方法
// if (window.plus) {
// this.plusReady();
// } else {
// document.addEventListener("plusready", this.plusReady, false);
// }
if (window.plus) {
this.plusReady();
} else {
document.addEventListener("plusready", this.plusReady, false);
}
},
components: {
// Keyboard
......@@ -98,45 +98,41 @@ export default {
methods: {
//app获取设备号方法
appGetDeviceId() {
let that = this;
let appDeviceId1 = window.Device.getDeviceId();
// let that = this;
// let appDeviceId1 = window.Device.getDeviceId();
if (appDeviceId1) {
that.deviceOAID = appDeviceId1;
//查询设备表是否存在该设备编号
httpGet(apiEquipmentQuery, { name: that.deviceOAID }).then(
(resSheiBei) => {
if (resSheiBei.code == 200 && resSheiBei.data.totalElements != 0) {
//查询车辆表中设备是否与车辆绑定
httpGet(vehicleInformationQuery, {
equipmentName: that.deviceOAID,
}).then((resCar) => {
if (resCar.code == 200 && resCar.data.totalElements != 0) {
that.bindingStatus = true;
} else {
that.bindingStatus = false;
}
});
} else {
httpPostForJson(apiEquipmentQuery, {
name: that.deviceOAID,
status: "正常",
}).then((res) => {
that.bindingStatus = false;
});
}
}
);
}
// // let appDeviceId1 = window.Device.getDeviceId();
// console.log("app设备号", window.Device);
// if (appDeviceId1) {
// that.deviceOAID = appDeviceId1;
// //查询设备表是否存在该设备编号
// httpGet(apiEquipmentQuery, { name: that.deviceOAID }).then(
// (resSheiBei) => {
// if (resSheiBei.code == 200 && resSheiBei.data.totalElements != 0) {
// //查询车辆表中设备是否与车辆绑定
// httpGet(vehicleInformationQuery, {
// equipmentName: that.deviceOAID,
// }).then((resCar) => {
// if (resCar.code == 200 && resCar.data.totalElements != 0) {
// that.bindingStatus = true;
// } else {
// that.bindingStatus = false;
// }
// });
// } else {
// httpPostForJson(apiEquipmentQuery, {
// name: that.deviceOAID,
// status: "正常",
// }).then((res) => {
// that.bindingStatus = false;
// });
// }
// }
// );
// }
},
//5+app获取OAID方法
plusReady() {
let that = this;
console.log("设备身份码:" + plus.device.imei);
console.log("用户识别码:" + plus.device.imsi);
console.log("设备型号信息:" + plus.device.model);
console.log("设备厂商信息:" + plus.device.vendor);
console.log("设备唯一标识号:" + plus.device.uuid);
// let that = this;
// plus.device.getOAID({
// success: function (e) {
// console.log("oaid", e.oaid);
......@@ -174,45 +170,6 @@ export default {
// that.bindingStatus = false;
// },
// });
//无法获取oaid的设备尝试获取uuid或imei
plus.device.getInfo({
success:function(e){
console.log('getDeviceInfo success: '+JSON.stringify(e));
that.deviceOAID = e.uuid;
//查询设备表是否存在该设备编号
httpGet(apiEquipmentQuery, { name: that.deviceOAID }).then(
(resSheiBei) => {
if (
resSheiBei.code == 200 &&
resSheiBei.data.totalElements != 0
) {
//查询车辆表中设备是否与车辆绑定
httpGet(vehicleInformationQuery, {
equipmentName: that.deviceOAID,
}).then((resCar) => {
if (resCar.code == 200 && resCar.data.totalElements != 0) {
that.bindingStatus = true;
} else {
that.bindingStatus = false;
}
});
} else {
httpPostForJson(apiEquipmentQuery, {
name: that.deviceOAID,
status: "正常",
}).then((res) => {
that.bindingStatus = false;
});
}
}
);
},
fail:function(e){
console.log('getDeviceInfo failed: '+JSON.stringify(e));
that.bindingStatus = false;
}
});
},
getCode() {
httpGet(code).then((res) => {
......
......@@ -56,8 +56,8 @@ export default {
data() {
return {
loginForm: {
username: "testkc",
password: "123456",
username: "",
password: "",
uuid: "",
},
loading: false,
......@@ -65,8 +65,7 @@ export default {
keyboardShowType: "",
//设备OAID testkc test999
//testcc deviceOAID: "test888",
deviceOAID: "test999",
// deviceOAID: "140945db5f9b8e04",
deviceOAID: "",
//判断设备是否与车绑定
bindingStatus: false,
//绑定的车牌号
......@@ -80,17 +79,18 @@ export default {
this.getCookie();
},
mounted() {
console.log(window, 1111111);
//两种方法相互冲突,每次只需要一种,并且获取的id不一样
//app获取设备号方法
// this.appGetDeviceId();
this.appGetDeviceId();
//5+app获取OAID方法
if (window.plus) {
this.plusReady();
} else {
document.addEventListener("plusready", this.plusReady, false);
}
// if (window.plus) {
// this.plusReady();
// } else {
// document.addEventListener("plusready", this.plusReady, false);
// }
},
components: {
// Keyboard
......@@ -98,41 +98,45 @@ export default {
methods: {
//app获取设备号方法
appGetDeviceId() {
// let that = this;
let that = this;
let appDeviceId1 = window.Device.getDeviceId();
// let appDeviceId1 = window.Device.getDeviceId();
// // let appDeviceId1 = window.Device.getDeviceId();
// console.log("app设备号", window.Device);
// if (appDeviceId1) {
// that.deviceOAID = appDeviceId1;
// //查询设备表是否存在该设备编号
// httpGet(apiEquipmentQuery, { name: that.deviceOAID }).then(
// (resSheiBei) => {
// if (resSheiBei.code == 200 && resSheiBei.data.totalElements != 0) {
// //查询车辆表中设备是否与车辆绑定
// httpGet(vehicleInformationQuery, {
// equipmentName: that.deviceOAID,
// }).then((resCar) => {
// if (resCar.code == 200 && resCar.data.totalElements != 0) {
// that.bindingStatus = true;
// } else {
// that.bindingStatus = false;
// }
// });
// } else {
// httpPostForJson(apiEquipmentQuery, {
// name: that.deviceOAID,
// status: "正常",
// }).then((res) => {
// that.bindingStatus = false;
// });
// }
// }
// );
// }
if (appDeviceId1) {
that.deviceOAID = appDeviceId1;
//查询设备表是否存在该设备编号
httpGet(apiEquipmentQuery, { name: that.deviceOAID }).then(
(resSheiBei) => {
if (resSheiBei.code == 200 && resSheiBei.data.totalElements != 0) {
//查询车辆表中设备是否与车辆绑定
httpGet(vehicleInformationQuery, {
equipmentName: that.deviceOAID,
}).then((resCar) => {
if (resCar.code == 200 && resCar.data.totalElements != 0) {
that.bindingStatus = true;
} else {
that.bindingStatus = false;
}
});
} else {
httpPostForJson(apiEquipmentQuery, {
name: that.deviceOAID,
status: "正常",
}).then((res) => {
that.bindingStatus = false;
});
}
}
);
}
},
//5+app获取OAID方法
plusReady() {
// let that = this;
let that = this;
console.log("设备身份码:" + plus.device.imei);
console.log("用户识别码:" + plus.device.imsi);
console.log("设备型号信息:" + plus.device.model);
console.log("设备厂商信息:" + plus.device.vendor);
console.log("设备唯一标识号:" + plus.device.uuid);
// plus.device.getOAID({
// success: function (e) {
// console.log("oaid", e.oaid);
......@@ -170,6 +174,45 @@ export default {
// that.bindingStatus = false;
// },
// });
//无法获取oaid的设备尝试获取uuid或imei
plus.device.getInfo({
success:function(e){
console.log('getDeviceInfo success: '+JSON.stringify(e));
that.deviceOAID = e.uuid;
//查询设备表是否存在该设备编号
httpGet(apiEquipmentQuery, { name: that.deviceOAID }).then(
(resSheiBei) => {
if (
resSheiBei.code == 200 &&
resSheiBei.data.totalElements != 0
) {
//查询车辆表中设备是否与车辆绑定
httpGet(vehicleInformationQuery, {
equipmentName: that.deviceOAID,
}).then((resCar) => {
if (resCar.code == 200 && resCar.data.totalElements != 0) {
that.bindingStatus = true;
} else {
that.bindingStatus = false;
}
});
} else {
httpPostForJson(apiEquipmentQuery, {
name: that.deviceOAID,
status: "正常",
}).then((res) => {
that.bindingStatus = false;
});
}
}
);
},
fail:function(e){
console.log('getDeviceInfo failed: '+JSON.stringify(e));
that.bindingStatus = false;
}
});
},
getCode() {
httpGet(code).then((res) => {
......
......@@ -157,6 +157,7 @@ export default {
putForJson(vehicleInformationUpdate,{id:res1.data.content[0].id,odo:0,oddStatus:1,workStatus:0,weightStatus:0}).then((res2) => {
//人员信息表中与车辆解绑
putForJson(personalCenterInforQuery,{id:this.personalInformationData.id,car:''}).then((res3) => {
this.logout();
//删除调度单子
// httpGet(dingDanBiaoCaoZuo,{carNo:this.carnumber}).then((res3Del) => {
// if(res3Del.code == 200 && res3Del.data.content.length != 0){
......@@ -175,7 +176,7 @@ export default {
})
},
logout() {
this.$router.push({path: "/login"});
this.$router.push({path: "/login"});
window.sessionStorage.clear();
window.localStorage.clear(); //清除所有key
window.isLogin = false;
......
......@@ -1579,6 +1579,18 @@ export default {
clearInterval(this.zongTimer2);
this.zongTimer2 = null;
}
if (this.posTimer) {
clearInterval(this.posTimer);
this.posTimer = null;
}
if (this.areaTimer) {
clearInterval(this.areaTimer);
this.areaTimer = null;
}
if (this.zongTimer3) {
clearInterval(this.zongTimer3);
this.zongTimer3 = null;
}
},
};
</script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment