问题:token超过30分钟后过期,但是用户一直操作30分钟后才触发Api,影响用户使用感
解决:25分钟生成新token(更改页面时触发Api)
vue:
router.beforeEach((to, from, next) => {
if (to.path === "/block") {
next();
} else if (!brower.mediaDevice()) {
next("/block");
} else {
if (sessionStorage.getItem("user")) {
store.state.user = JSON.parse(AESUtil.decrypt(sessionStorage.getItem("user")));
}
if (to.path === "/login") {
next();
} else {
//迁移到登录画面的情况
const destinationURL = sessionStorage.getItem("destinationFullPath");
//登录后画面迁移
if (to.path === "/top" && destinationURL && destinationURL != "/top") {
sessionStorage.setItem("currentMenu", sessionStorage.getItem("destinationSubPath"));
next(destinationURL);
}
if (sessionStorage.getItem("to