mirror of
https://gitee.com/likeadmin/likeadmin_java.git
synced 2026-09-06 14:47:54 +08:00
初始化admin pc端
This commit is contained in:
17
admin/src/views/error/404.vue
Normal file
17
admin/src/views/error/404.vue
Normal file
@@ -0,0 +1,17 @@
|
||||
<template>
|
||||
<div class="error404">
|
||||
<error :code="404" title="哎呀,出错了!您访问的页面不存在…"></error>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue'
|
||||
import Error from './components/error.vue'
|
||||
export default defineComponent({
|
||||
components: {
|
||||
Error
|
||||
},
|
||||
setup() {}
|
||||
})
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
17
admin/src/views/error/500.vue
Normal file
17
admin/src/views/error/500.vue
Normal file
@@ -0,0 +1,17 @@
|
||||
<template>
|
||||
<div class="error500">
|
||||
<error :code="500" title="哎呀,出错了!系统错误,请稍后再试…"></error>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue'
|
||||
import Error from './components/error.vue'
|
||||
export default defineComponent({
|
||||
components: {
|
||||
Error
|
||||
},
|
||||
setup() {}
|
||||
})
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
60
admin/src/views/error/components/error.vue
Normal file
60
admin/src/views/error/components/error.vue
Normal file
@@ -0,0 +1,60 @@
|
||||
<template>
|
||||
<div class="error">
|
||||
<div>
|
||||
<div class="error-code">{{ code }}</div>
|
||||
<div class="lg lighter m-t-30 m-b-30">
|
||||
{{ title }}
|
||||
</div>
|
||||
<el-button type="primary" size="small" @click="$router.go(-1)">
|
||||
{{ second }} 秒后返回上一页
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { useAdmin } from '@/core/hooks/app'
|
||||
import { defineComponent, onUnmounted, ref } from 'vue'
|
||||
export default defineComponent({
|
||||
props: {
|
||||
code: Number,
|
||||
title: String
|
||||
},
|
||||
setup() {
|
||||
let timer: any = null
|
||||
const second = ref(5)
|
||||
const { router } = useAdmin()
|
||||
timer = setInterval(() => {
|
||||
if (second.value === 0) {
|
||||
clearInterval(timer)
|
||||
router.go(-1)
|
||||
} else {
|
||||
second.value--
|
||||
}
|
||||
}, 1000)
|
||||
onUnmounted(() => {
|
||||
clearInterval(timer)
|
||||
})
|
||||
|
||||
return {
|
||||
second
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.error {
|
||||
text-align: center;
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
.error-code {
|
||||
color: $color-primary;
|
||||
font-size: 150px;
|
||||
}
|
||||
.el-button {
|
||||
width: 176px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user