Commit d7ef8ee6 authored by 李鹏 's avatar 李鹏

文档类型管理接口联调

parent 6de16948
...@@ -115,7 +115,7 @@ export default { ...@@ -115,7 +115,7 @@ export default {
// this.initMsg() // this.initMsg()
}, },
mounted() { mounted() {
this.getSysOptions(); // this.getSysOptions();
}, },
methods: { methods: {
/** /**
...@@ -123,54 +123,54 @@ export default { ...@@ -123,54 +123,54 @@ export default {
* limit:用户无操作时常限制(分钟) * limit:用户无操作时常限制(分钟)
*/ */
exitSystemAfterLimit(limit) { // exitSystemAfterLimit(limit) {
window.lastOperateTime = new Date(); // window.lastOperateTime = new Date();
window.onload = this.addOperateListener; // window.onload = this.addOperateListener;
this.setTimer(limit); // this.setTimer(limit);
}, // },
//绑定用户操作事件 //绑定用户操作事件
addOperateListener() { // addOperateListener() {
document.addEventListener("mousemove", this.resetStartTime); // document.addEventListener("mousemove", this.resetStartTime);
document.addEventListener("keydown", this.resetStartTime); // document.addEventListener("keydown", this.resetStartTime);
document.addEventListener("scroll", this.resetStartTime); // document.addEventListener("scroll", this.resetStartTime);
document.addEventListener("touchstart", this.resetStartTime); // document.addEventListener("touchstart", this.resetStartTime);
}, // },
//重置起始时间 //重置起始时间
resetStartTime() { // resetStartTime() {
window.lastOperateTime = new Date(); // window.lastOperateTime = new Date();
}, // },
//设置定时器 //设置定时器
setTimer(limit) { // setTimer(limit) {
window.logTimer = setInterval(() => { // window.logTimer = setInterval(() => {
var currentTime = new Date(); // var currentTime = new Date();
var timeDiff = currentTime.getTime() - lastOperateTime.getTime(); // var timeDiff = currentTime.getTime() - lastOperateTime.getTime();
if (timeDiff > limit * 60 * 1000) { // if (timeDiff > limit * 60 * 1000) {
clearInterval(window.logTimer); // clearInterval(window.logTimer);
this.$axios.post(`/apaas/system/v5/user/logout`).then((res) => { // this.$axios.post(`/apaas/system/v5/user/logout`).then((res) => {
if (res.data.code == "200") { // if (res.data.code == "200") {
window.location.href = `/apaas/manage/ui/#/login`; // window.location.href = `/apaas/manage/ui/#/login`;
this.$store.commit("setUserInfo", null); // this.$store.commit("setUserInfo", null);
clearCookie("bgToken"); // clearCookie("bgToken");
this.$message.success("退出成功"); // this.$message.success("退出成功");
resetRouter(); // resetRouter();
} else { // } else {
this.$message.error("退出失败"); // this.$message.error("退出失败");
} // }
}); // });
} // }
}, 1000); // }, 1000);
}, // },
getSysOptions() { // getSysOptions() {
this.$axios.get(`/apaas/system/v5/sysOptions`).then((res) => { // this.$axios.get(`/apaas/system/v5/sysOptions`).then((res) => {
if (res.data.code == 200) { // if (res.data.code == 200) {
const result = res.data.data || {}; // const result = res.data.data || {};
if (result.session_validity) this.exitSystemAfterLimit(result.session_validity); // if (result.session_validity) this.exitSystemAfterLimit(result.session_validity);
} else { // } else {
this.$message.error(res.data.data); // this.$message.error(res.data.data);
} // }
}); // });
}, // },
openMsg(data) { openMsg(data) {
this.readFlag = !this.readFlag; this.readFlag = !this.readFlag;
......
...@@ -56,6 +56,15 @@ export default { ...@@ -56,6 +56,15 @@ export default {
changeOrigin: true, changeOrigin: true,
secure: false, secure: false,
}, },
"/apaas/knowledge/v5": {
target: "https://apaas5.wodcloud.com/apaas/knowledge/v5", // 所要代理的目标地址
rewrite: (path) => {
console.log("path", path);
return path.replace(/^\/apaas\/knowledge\/v5/, "");
}, // 重写传过来的path路径,比如 `/api/index/1?id=10&name=zs`(注意:path路径最前面有斜杠(/),因此,正则匹配的时候不要忘了是斜杠(/)开头的;选项的 key 也是斜杠(/)开头的)
changeOrigin: true, // true/false, Default: false - changes the origin of the host header to the target URL
secure: false, //解决证书缺失问题
},
}, },
}, },
build: { build: {
......
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