提交系统维护页面

This commit is contained in:
X1627315083
2024-02-22 10:05:24 +08:00
parent 0d85fd74e0
commit 3708ca0d34
2 changed files with 37 additions and 36 deletions

View File

@@ -70,43 +70,43 @@ const router = createRouter({
}) })
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
// 系统维护 // 系统维护
// const toName = to.name === 'upgrade'; const toName = to.name === 'upgrade';
// if (toName) { if (toName) {
// next(); next();
// } else { } else {
// next({ name: 'upgrade' }); next({ name: 'upgrade' });
// } }
// 检查路由是否存在 // 检查路由是否存在
// 机房用户 // 机房用户
let murmurStr: any = localStorage.getItem('murmurStr') // let murmurStr: any = localStorage.getItem('murmurStr')
let getIsMurmur: any = getCookie("isMurmur") // let getIsMurmur: any = getCookie("isMurmur")
let token = getCookie("token"); // let token = getCookie("token");
let isMurmur = JSON.parse(getIsMurmur) // let isMurmur = JSON.parse(getIsMurmur)
const routeExists = router.getRoutes().some(({ name }) =>{ // const routeExists = router.getRoutes().some(({ name }) =>{
if(name){ // if(name){
return name === to.name // return name === to.name
}else{ // }else{
return false // return false
} // }
}); // });
if (routeExists) { // if (routeExists) {
if (isMurmur && murmurStr && token) { // if (isMurmur && murmurStr && token) {
const toName = to.name === 'login'; // const toName = to.name === 'login';
if (toName) { // if (toName) {
next({ name: 'home' }); // next({ name: 'home' });
} else { // } else {
next(); // next();
} // }
} else { // } else {
// 如果页面存在,正常跳转 // // 如果页面存在,正常跳转
next(); // next();
} // }
next(); // next();
} else { // } else {
// 如果页面不存在可以跳转到404页面或者其他页面 // // 如果页面不存在可以跳转到404页面或者其他页面
next('/404'); // next('/404');
} // }
}); });

View File

@@ -5,8 +5,9 @@
<i class="fi fi-rr-settings"></i> <i class="fi fi-rr-settings"></i>
</div> </div>
<div class="upgrade-content-wire"></div> <div class="upgrade-content-wire"></div>
<div class="upgrade-content-text">System upgrading</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 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>
</div> </div>
</template> </template>