提交系统维护页面
This commit is contained in:
@@ -70,43 +70,43 @@ const router = createRouter({
|
||||
})
|
||||
router.beforeEach((to, from, next) => {
|
||||
// 系统维护
|
||||
// const toName = to.name === 'upgrade';
|
||||
// if (toName) {
|
||||
// next();
|
||||
// } else {
|
||||
// next({ name: 'upgrade' });
|
||||
// }
|
||||
// 检查路由是否存在
|
||||
// 机房用户
|
||||
let murmurStr: any = localStorage.getItem('murmurStr')
|
||||
let getIsMurmur: any = getCookie("isMurmur")
|
||||
let token = getCookie("token");
|
||||
let isMurmur = JSON.parse(getIsMurmur)
|
||||
|
||||
const routeExists = router.getRoutes().some(({ name }) =>{
|
||||
if(name){
|
||||
return name === to.name
|
||||
}else{
|
||||
return false
|
||||
}
|
||||
});
|
||||
if (routeExists) {
|
||||
if (isMurmur && murmurStr && token) {
|
||||
const toName = to.name === 'login';
|
||||
if (toName) {
|
||||
next({ name: 'home' });
|
||||
} else {
|
||||
next();
|
||||
}
|
||||
} else {
|
||||
// 如果页面存在,正常跳转
|
||||
next();
|
||||
}
|
||||
const toName = to.name === 'upgrade';
|
||||
if (toName) {
|
||||
next();
|
||||
} else {
|
||||
// 如果页面不存在,可以跳转到404页面或者其他页面
|
||||
next('/404');
|
||||
next({ name: 'upgrade' });
|
||||
}
|
||||
// 检查路由是否存在
|
||||
// 机房用户
|
||||
// let murmurStr: any = localStorage.getItem('murmurStr')
|
||||
// let getIsMurmur: any = getCookie("isMurmur")
|
||||
// let token = getCookie("token");
|
||||
// let isMurmur = JSON.parse(getIsMurmur)
|
||||
|
||||
// const routeExists = router.getRoutes().some(({ name }) =>{
|
||||
// if(name){
|
||||
// return name === to.name
|
||||
// }else{
|
||||
// return false
|
||||
// }
|
||||
// });
|
||||
// if (routeExists) {
|
||||
// if (isMurmur && murmurStr && token) {
|
||||
// const toName = to.name === 'login';
|
||||
// if (toName) {
|
||||
// next({ name: 'home' });
|
||||
// } else {
|
||||
// next();
|
||||
// }
|
||||
// } else {
|
||||
// // 如果页面存在,正常跳转
|
||||
// next();
|
||||
// }
|
||||
// next();
|
||||
// } else {
|
||||
// // 如果页面不存在,可以跳转到404页面或者其他页面
|
||||
// next('/404');
|
||||
// }
|
||||
|
||||
|
||||
});
|
||||
|
||||
@@ -5,8 +5,9 @@
|
||||
<i class="fi fi-rr-settings"></i>
|
||||
</div>
|
||||
<div class="upgrade-content-wire"></div>
|
||||
<div class="upgrade-content-text">System upgrading</div>
|
||||
<div class="upgrade-content-textab">The system update will begin at January 26th and is expected to be completed by January 28th.</div>
|
||||
<!-- <div class="upgrade-content-text">System upgrading</div> -->
|
||||
<div class="upgrade-content-text">System maintenance</div>
|
||||
<!-- <div class="upgrade-content-textab">The system update will begin at January 26th and is expected to be completed by January 28th.</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user