首页未登录点击没有任何界面,直接跳转到登陆页面

This commit is contained in:
WIN-5KTJHN9GRFL\LENOVO 2025-10-30 11:32:42 +08:00
parent 6f8f58feab
commit d7242a9e9f

View File

@ -400,12 +400,32 @@ const viewTerrain = (id) => {
router.push(`/terrain?id=${id}`)
}
const viewCompetition = (id) => {
router.push(`/competition/detail?id=${id}`)
const viewCompetition = async (id) => {
try{
const userInfo = await getUserInfo()
if (!userInfo) {
await router.push('/backend/login')
return
}
await router.push(`/competition/detail?id=${id}`)
}catch(error){
await router.push('/backend/login')
}
const viewDemand = (id) => {
router.push(`/demands?id=${id}`)
}
const viewDemand = async (id) => {
try{
const userInfo = await getUserInfo()
if (!userInfo) {
await router.push('/backend/login')
return
}
await router.push(`/demands?id=${id}`)
}catch(error){
await router.push('/backend/login')
}
}
//