Compare commits

..

No commits in common. "7496f14e6331350273a48662a1246e69f6b685a4" and "abf7531d5a7f89f4e2df8e78136691d6aaf216bb" have entirely different histories.

3 changed files with 2 additions and 40 deletions

View File

@ -1,3 +1,3 @@
<template> <template>
<router-view /> <router-view />
</template> </template>

View File

@ -2,7 +2,7 @@ import axios from "axios";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import tools from "@/utils/tools"; import tools from "@/utils/tools";
import router from "../router"; import router from "../router";
axios.defaults.baseURL = 'https://jzzf.longyou.gov.cn:998/' // axios.defaults.baseURL = 'https://jzzf.longyou.gov.cn:998/'
axios.defaults.timeout = 120000; axios.defaults.timeout = 120000;
// HTTP request 拦截器 // HTTP request 拦截器
@ -37,7 +37,6 @@ axios.interceptors.response.use(
const name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie; const name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie;
document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/;"; document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/;";
} }
let backurl=window.location.href; let backurl=window.location.href;
tools.data.set("backUrl",backurl); tools.data.set("backUrl",backurl);
router.replace({ router.replace({

View File

@ -137,8 +137,6 @@ const getCookie = (cname) => {
}; };
// //
const login = () => { const login = () => {
console.log(111111111);
let backurl = tools.data.get("backUrl"); let backurl = tools.data.get("backUrl");
dd.getAuthCode() dd.getAuthCode()
.then((res) => { .then((res) => {
@ -155,8 +153,6 @@ const login = () => {
tools.data.set("type", 1); tools.data.set("type", 1);
getMenu(); getMenu();
if (backurl) { if (backurl) {
console.log(222222);
window.location.href = backurl; window.location.href = backurl;
tools.data.remove("backUrl"); tools.data.remove("backUrl");
} }
@ -214,17 +210,13 @@ const login = () => {
tools.data.set("token", token); tools.data.set("token", token);
tools.data.set("type", 2); tools.data.set("type", 2);
getMenu(); getMenu();
window.addEventListener("mousemove", resetTimer);
window.addEventListener("keydown", resetTimer);
if (backurl) { if (backurl) {
console.log(33333333333);
window.location.href = backurl; window.location.href = backurl;
tools.data.remove("backUrl"); tools.data.remove("backUrl");
} }
} else { } else {
var tokenPd = getCookie("lytoken"); var tokenPd = getCookie("lytoken");
if (!tokenPd) { if (!tokenPd) {
ElMessage.error("11111111!");
window.location.href = window.location.href =
"http://220.191.238.50:996/api/login?returnURL=" + "http://220.191.238.50:996/api/login?returnURL=" +
window.location.href; window.location.href;
@ -234,7 +226,6 @@ const login = () => {
} }
}); });
}; };
// //
const getMenu = () => { const getMenu = () => {
http.get(`/api/ggfwyth/account/roleMenu`).then((res) => { http.get(`/api/ggfwyth/account/roleMenu`).then((res) => {
@ -253,34 +244,6 @@ const reset_font = () => {
document.querySelector("#m").style.transform = document.querySelector("#m").style.transform =
"scale(" + width / 1920 + "," + height / 1080 + ")"; "scale(" + width / 1920 + "," + height / 1080 + ")";
}; };
//退
const inactivityTimer = ref(null);
const resetTimer = () => {
clearTimeout(inactivityTimer.value);
inactivityTimer.value = setTimeout(() => {
//
// ElMessage.error("!");
// cook
ElMessage.error("长时间未操作,请重新登录");
window.removeEventListener("mousemove", resetTimer);
window.removeEventListener("keydown", resetTimer);
const cookies = document.cookie.split(";");
for (let i = 0; i < cookies.length; i++) {
const cookie = cookies[i];
const eqPos = cookie.indexOf("=");
const name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie;
document.cookie =
name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/;";
}
let backurl = window.location.href;
tools.data.set("backUrl", backurl);
router.replace({
path: "/guide",
});
window.location.href =
"http://220.191.238.50:996/api/login?returnURL=" + window.location.href;
}, 30 * 60 * 1000); // 30
};
onMounted(() => { onMounted(() => {
login(); login();