新版本官网优化完成

This commit is contained in:
2025-02-12 16:37:07 +08:00
parent 43a2e17a80
commit 3efdbfc662
547 changed files with 23001 additions and 28169 deletions

View File

@@ -0,0 +1,34 @@
import {useIsMobile, useToken} from "~/composables/configState";
/**
* @description 路由守卫
*/
export default defineNuxtRouteMiddleware((to, from) => {
const matchers = ['/user'];
if(matchers.includes(to.path)){
if(import.meta.client){
let token = useToken()
if(!token.value){
console.log('ekekekekeke')
return navigateTo({
path: '/passport/login',
query: {
redirect: to.path
}
})
}
}
}
// 手机版跳转
if(import.meta.client) {
const mobile = useIsMobile();
const isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
if (isMobile) {
mobile.value = true;
if (to.path.indexOf('/m') < 0) {
return window.location.href = `/m`
}
}
}
})