时间戳路由

This commit is contained in:
faiz 2024-11-26 16:57:44 +08:00
parent c9e5ea02fb
commit 468aabdfe6
1 changed files with 6 additions and 1 deletions

View File

@ -13,6 +13,7 @@ NProgress.configure({ showSpinner: false }); // NProgress Configuration
const whiteList = [`${roterPre}/login`, "/auth-redirect"]; // no redirect whitelist
router.beforeEach(async (to, from, next) => {
// start progress bar
NProgress.start();
// set page title
@ -43,7 +44,11 @@ router.beforeEach(async (to, from, next) => {
NProgress.done();
});
} else {
next();
if (!to.query.t) {
next({ ...to, query: { ...to.query, t: Date.now() } })
} else {
next()
}
NProgress.done();
}
}