mirror of
https://gitee.com/dromara/go-view.git
synced 2026-04-23 00:00:12 +08:00
修改样式细节,修改utils
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import { ResultEnum } from "@/enums/httpEnum"
|
||||
import { ErrorPageNameMap } from "@/enums/pageEnum"
|
||||
import router from '@/router';
|
||||
|
||||
/**
|
||||
* * 错误页重定向
|
||||
* @param icon
|
||||
* @returns
|
||||
*/
|
||||
export const redirectErrorPage = (code: ResultEnum) => {
|
||||
if(!code) return false
|
||||
const pageName = ErrorPageNameMap.get(code)
|
||||
if(!pageName) return false
|
||||
routerTurnByName(pageName)
|
||||
}
|
||||
|
||||
/**
|
||||
* * 根据名字跳转路由
|
||||
* @param pageName
|
||||
*/
|
||||
export const routerTurnByName = (pageName: string) => {
|
||||
router.push({
|
||||
name: pageName
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user