feat: 404
This commit is contained in:
parent
bfa39ef17e
commit
5c226a6ba8
@ -47,10 +47,14 @@ instance.interceptors.response.use(
|
|||||||
return response
|
return response
|
||||||
},
|
},
|
||||||
(err: any) => {
|
(err: any) => {
|
||||||
|
console.log(err)
|
||||||
if (err.code === 'ECONNABORTED') {
|
if (err.code === 'ECONNABORTED') {
|
||||||
MsgError(err.message)
|
MsgError(err.message)
|
||||||
console.error(err)
|
console.error(err)
|
||||||
}
|
}
|
||||||
|
if (err.response?.status === 404) {
|
||||||
|
router.push('/404 ')
|
||||||
|
}
|
||||||
if (err.response?.status === 401) {
|
if (err.response?.status === 401) {
|
||||||
router.push({ name: 'login' })
|
router.push({ name: 'login' })
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,19 +1,16 @@
|
|||||||
<template >
|
<template>
|
||||||
<el-row class="not-found-container">
|
<el-row class="not-found-container">
|
||||||
<el-col class="img" :span="12">
|
<el-col class="img" :span="12"> </el-col>
|
||||||
|
|
||||||
</el-col>
|
|
||||||
<el-col class="message-container" :span="12">
|
<el-col class="message-container" :span="12">
|
||||||
<div class="title">404</div>
|
<div class="title">404</div>
|
||||||
<div class="message">很抱歉,您要访问的页面地址有误,或者该页面不存在。</div>
|
<div class="message">很抱歉,无法访问应用!</div>
|
||||||
<div class="operate"><el-button type="primary" @click="router.push('/')">返回首页</el-button></div>
|
<!-- <div class="operate"><el-button type="primary" @click="router.push('/')">返回首页</el-button></div> -->
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router'
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.not-found-container {
|
.not-found-container {
|
||||||
@ -36,14 +33,12 @@ const router = useRouter()
|
|||||||
.title {
|
.title {
|
||||||
font-size: 50px;
|
font-size: 50px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.message {
|
.message {
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
margin: 50px 0 20px 0;
|
margin: 30px 0 20px 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
Loading…
Reference in New Issue
Block a user