|
@@ -391,6 +391,7 @@ import {
|
|
|
import { store } from "@/store";
|
|
|
import { SpaceInfoModel } from "@/model/userModel";
|
|
|
import { getWorkType } from "@/utils/mapIcon";
|
|
|
+import { getCookieMac } from "@/utils/cookies";
|
|
|
|
|
|
export default defineComponent({
|
|
|
components: {
|
|
@@ -417,6 +418,15 @@ export default defineComponent({
|
|
|
VanPopup: Popup,
|
|
|
VanIcon: Icon,
|
|
|
},
|
|
|
+ beforeRouteEnter(to, from, next) {
|
|
|
+ let mac: any = getCookieMac();
|
|
|
+ if (mac && mac !== "null") {
|
|
|
+ next();
|
|
|
+ } else {
|
|
|
+ next("/error");
|
|
|
+ }
|
|
|
+ // next()
|
|
|
+ },
|
|
|
setup() {
|
|
|
const proxyGlobal: any = getCurrentInstance();
|
|
|
const router: any = useRouter();
|
|
@@ -547,6 +557,7 @@ export default defineComponent({
|
|
|
let userSpaceInfo: any = [];
|
|
|
let spaceModelTimer: any = null;
|
|
|
let spaceTempTimer: any = null;
|
|
|
+ let dateInter: any = null;
|
|
|
let envlist: any = [
|
|
|
{
|
|
|
id: 2,
|
|
@@ -1948,9 +1959,17 @@ export default defineComponent({
|
|
|
proxyData.queryCustomerserviceTimer();
|
|
|
});
|
|
|
},
|
|
|
+ dateInter: dateInter,
|
|
|
+ setDateTime() {
|
|
|
+ proxyData.dateInter = setInterval(() => {
|
|
|
+ proxyData.nowDate = formatDate("YYYY.MM.DD HH:mm");
|
|
|
+ proxyData.nowWeek = getNowWeek();
|
|
|
+ }, 60000);
|
|
|
+ },
|
|
|
});
|
|
|
onBeforeUnmount(() => {
|
|
|
proxyData.clearAll();
|
|
|
+ clearInterval(proxyData.dateInter);
|
|
|
clearTimeout(proxyData.cusServiceTimer);
|
|
|
clearTimeout(proxyData.weatherTimer);
|
|
|
});
|
|
@@ -1962,6 +1981,7 @@ export default defineComponent({
|
|
|
proxyData.defaultSpace = {
|
|
|
spaceId: spaceId,
|
|
|
};
|
|
|
+ proxyData.setDateTime()
|
|
|
proxyData.init();
|
|
|
// 获取当前平板绑定的空间
|
|
|
proxyData.queryWorkSpace();
|