提交 d1526317 编写于 作者: ibizdev's avatar ibizdev

zhujiamin 发布系统代码 [TrainSys,网页端]

上级 51e81b57
......@@ -4,6 +4,14 @@ import { getCookie, setCookie } from 'qx-util';
import { UnauthorizedHandler } from '../unauthorized-handler/unauthorized-handler';
import { PluginFactory } from '@/plugin';
/**
* 刷新token定时器id
*
* @author: zhujiamin
* @Date: 2023-12-15 11:27:16
*/
let refreshTokenTimeId: NodeJS.Timeout | undefined;
/**
* 预加载应用级引用插件
*
......@@ -98,6 +106,10 @@ async function loadOrgData(): Promise<void> {
* @date 2023-02-13 09:09:23
*/
function setRefreshToken() {
// 清除之前的定时器
if (refreshTokenTimeId) {
clearTimeout(refreshTokenTimeId);
}
const token = getCookie(CoreConst.TOKEN);
const expirein = getCookie(CoreConst.TOKEN_EXPIRES);
if (token && expirein) {
......@@ -105,7 +117,7 @@ function setRefreshToken() {
let wait = Number(expirein) - new Date().getTime();
const early = 5 * 60 * 1000;
wait = wait > early ? wait - early : 0;
setTimeout(async () => {
refreshTokenTimeId = setTimeout(async () => {
const res = await ibiz.net.get(`/uaa/refreshtoken2`);
if (res.ok) {
setCookie(CoreConst.TOKEN, res.data.token, 0, true);
......
......@@ -12107,12 +12107,6 @@
"codeName" : "VMGroup3",
"name" : "视图消息类型测试",
"getPSAppViewMsgGroupDetails" : [ {
"name" : "消息类型-常规信息",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg4"
}
}, {
"name" : "消息类型-错误信息",
"getPSAppViewMsg" : {
"modelref" : true,
......@@ -12124,6 +12118,12 @@
"modelref" : true,
"id" : "ViewMsg5"
}
}, {
"name" : "消息类型-常规信息",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg4"
}
} ]
}, {
"codeName" : "VMGroup7",
......@@ -12139,16 +12139,16 @@
"codeName" : "VMGroup4",
"name" : "视图消息位置测试",
"getPSAppViewMsgGroupDetails" : [ {
"name" : "消息位置-弹出",
"name" : "消息位置-视图下方",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg10"
"id" : "ViewMsg8"
}
}, {
"name" : "消息位置-视图下方",
"name" : "消息位置-弹出",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg8"
"id" : "ViewMsg10"
}
}, {
"name" : "消息位置-视图内容区",
......@@ -12167,37 +12167,30 @@
"codeName" : "VMGroup8",
"name" : "【静态测试】",
"getPSAppViewMsgGroupDetails" : [ {
"name" : "消息类型-错误信息",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg6"
},
"position" : "POPUP"
}, {
"name" : "关闭模式-无删除-上方-常规",
"name" : "关闭模式-默认删除-上方-错误",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg11"
"id" : "ViewMsg12"
}
}, {
"name" : "消息类型-常规信息",
"name" : "消息位置-视图内容区",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg4"
},
"position" : "POPUP"
"id" : "ViewMsg9"
}
}, {
"name" : "关闭模式-默认删除-上方-错误",
"name" : "关闭模式-本次删除-上方-警告",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg12"
"id" : "ViewMsg13"
}
}, {
"name" : "消息位置-视图内容区",
"name" : "消息类型-错误信息",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg9"
}
"id" : "ViewMsg6"
},
"position" : "POPUP"
}, {
"name" : "消息位置-视图下方",
"getPSAppViewMsg" : {
......@@ -12205,11 +12198,18 @@
"id" : "ViewMsg8"
}
}, {
"name" : "关闭模式-本次删除-上方-警告",
"name" : "关闭模式-无删除-上方-常规",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg13"
"id" : "ViewMsg11"
}
}, {
"name" : "消息类型-常规信息",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg4"
},
"position" : "POPUP"
}, {
"name" : "消息类型-警告信息",
"getPSAppViewMsg" : {
......@@ -12222,10 +12222,10 @@
"codeName" : "VMGroup5",
"name" : "视图消息关闭模式",
"getPSAppViewMsgGroupDetails" : [ {
"name" : "关闭模式-默认删除",
"name" : "关闭模式-本次删除",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg12"
"id" : "ViewMsg13"
}
}, {
"name" : "关闭模式-无删除",
......@@ -12234,10 +12234,10 @@
"id" : "ViewMsg11"
}
}, {
"name" : "关闭模式-本次删除",
"name" : "关闭模式-默认删除",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg13"
"id" : "ViewMsg12"
}
} ]
}, {
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册