Commit 43ea53e8 authored by 方建宇's avatar 方建宇

警告接口、热用户数据接口、AI无人站接口

parent 22f69d70
......@@ -6,22 +6,22 @@ import store from "@/store/index.js";
export function handleGetAIToken() {
return new Promise((resolve, reject) => {
const AIToken = localStorage.getItem('AIToken');
if (AIToken) {
// 有存储token判断token有没有过期
// 检验token是否过期
checkToken(AIToken).then(res => {
if (res.data === false) {
localStorage.removeItem('AIToken');
// token过期
getToken().then(resolve).catch(reject);
} else {
resolve();
}
}).catch(reject);
} else {
// 没有token的话获取存储token
getToken().then(resolve).catch(reject);
}
// if (AIToken) {
// // 有存储token判断token有没有过期
// // 检验token是否过期
// checkToken(AIToken).then(res => {
// if (res.data === false) {
// localStorage.removeItem('AIToken');
// // token过期
// getToken().then(resolve).catch(reject);
// } else {
// resolve();
// }
// }).catch(reject);
// } else {
// // 没有token的话获取存储token
// getToken().then(resolve).catch(reject);
// }
});
}
......@@ -31,17 +31,17 @@ function getToken() {
const userId = userInfo.userId;
const params = { username: userName };
// 通过userName获取uuid
return getAuthUUID(params).then(res => {
const uuid = res.data;
const params = {
userId: userId,
username: userName,
uuid: uuid,
};
// return getAuthUUID(params).then(res => {
// const uuid = res.data;
// const params = {
// userId: userId,
// username: userName,
// uuid: uuid,
// };
// 通过userId,username,uuid获取token
return createToken(params).then(res => {
const token = res.data;
localStorage.setItem('AIToken', token);
});
});
// return createToken(params).then(r-es => {
// const token = res.data;
// localStorage.setItem('AIToken', token);
// });
// });
}
......@@ -490,17 +490,20 @@ async function getName() {
//根据参数获得数据
async function getHisDataByInfo(name, start, end, startPage, pagesCount, sort) {
loading.value = true
await http.post(dataUrl, { name: name, startTime: start, endTime: end, start: startPage, count: pagesCount, sort: sort }).then((result) => {
if (result.status === 0) {
// await http.post(dataUrl, { name: name, startTime: start, endTime: end, start: startPage, count: pagesCount, sort: sort }).then((result) => {
// if (result.status === 0) {
//处理返回数据
tableInfo.hisData = result.data.dataInfoList;
total.value = result.data.rowCount;
// tableInfo.hisData = result.data.dataInfoList;
// total.value = result.data.rowCount;
// setshowData();
tableInfo.hisData = tigerTigerHeatUserHis.dataInfoList;
total.value = tigerTigerHeatUserHis.rowCount;
setshowData();
} else {
tableInfo.tableData.length = 0;
total.value=0;
}
})
// } else {
// tableInfo.tableData.length = 0;
// total.value=0;
// }
// })
loading.value = false
}
......
......@@ -864,80 +864,80 @@ export default defineComponent({
RoleId: roleIds.value,
};
}
function alarm() {
http
.post("/api/alarm/GetAlarmMsg", AlarmInfo.value, false)
.then((result) => {
if (result.success && result.data.lenth === 0 && sta.value === 0) {
sta.value = 1;
title.value = result.data[0].title;
msg.value = result.data[0].msg;
id.value = result.data[0].id;
ElNotification({
title: title.value,
dangerouslyUseHTMLString: true,
message: msg.value.replace("\n", "<br />"),
position: "bottom-right",
type: "error",
duration: 0,
onClick() {
activeTable.value = "/Video";
localStorage.setItem("activeTab", "/Video");
//路由跳转
this.$router.push({
//如果要是用 name 传参 就直接 携带一个 query 对象中包含参数
path: "/Video",
query: {
id: id.value,
},
});
},
onClose() {
sta.value = 0;
},
});
}
});
}
function countalarm() {
http.post("/api/alarm/GetAlarmMsg", AlarmInfo.value).then((result) => {
if (result.success && result.data.lenth === 0 && consta.value === 0) {
consta.value = 1;
counttitle.value = result.data[1].title;
countmsg.value = result.data[1].msg;
countid.value = result.data[1].id;
ElNotification({
title: counttitle.value,
dangerouslyUseHTMLString: true,
message: countmsg.value.replace("\n", "<br />"),
position: "bottom-right",
type: "error",
duration: 0,
onClick() {
activeTable.value = "/Video";
localStorage.setItem("activeTab", "/Video");
//路由跳转
this.$router.push({
//如果要是用 name 传参 就直接 携带一个 query 对象中包含参数
path: "/Video",
query: {
id: countid.value,
},
});
},
onClose() {
consta.value = 0;
},
});
}
});
}
setInterval(() => {
getinfo();
alarm();
countalarm();
}, 60 * 1000); // 每分钟执行一次
//警告接口
// function alarm() {
// http
// .post("/api/alarm/GetAlarmMsg", AlarmInfo.value, false)
// .then((result) => {
// if (result.success && result.data.lenth === 0 && sta.value === 0) {
// sta.value = 1;
// title.value = result.data[0].title;
// msg.value = result.data[0].msg;
// id.value = result.data[0].id;
// ElNotification({
// title: title.value,
// dangerouslyUseHTMLString: true,
// message: msg.value.replace("\n", "<br />"),
// position: "bottom-right",
// type: "error",
// duration: 0,
// onClick() {
// activeTable.value = "/Video";
// localStorage.setItem("activeTab", "/Video");
// //路由跳转
// this.$router.push({
// //如果要是用 name 传参 就直接 携带一个 query 对象中包含参数
// path: "/Video",
// query: {
// id: id.value,
// },
// });
// },
// onClose() {
// sta.value = 0;
// },
// });
// }
// });
// }
// function countalarm() {
// http.post("/api/alarm/GetAlarmMsg", AlarmInfo.value).then((result) => {
// if (result.success && result.data.lenth === 0 && consta.value === 0) {
// consta.value = 1;
// counttitle.value = result.data[1].title;
// countmsg.value = result.data[1].msg;
// countid.value = result.data[1].id;
// ElNotification({
// title: counttitle.value,
// dangerouslyUseHTMLString: true,
// message: countmsg.value.replace("\n", "<br />"),
// position: "bottom-right",
// type: "error",
// duration: 0,
// onClick() {
// activeTable.value = "/Video";
// localStorage.setItem("activeTab", "/Video");
// //路由跳转
// this.$router.push({
// //如果要是用 name 传参 就直接 携带一个 query 对象中包含参数
// path: "/Video",
// query: {
// id: countid.value,
// },
// });
// },
// onClose() {
// consta.value = 0;
// },
// });
// }
// });
// }
// setInterval(() => {
// getinfo();
// alarm();
// countalarm();
// }, 60 * 1000); // 每分钟执行一次
//个人资料弹出框
const funsel = ref(true);
......
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