1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<template>
<div class="app-error-view">
<div class="app-error-container">
<img src="@/assets/img/500.png" />
<div class="error-text">
<div class="error-text1">{{ $t('components.500.errortext1') }}</div>
<div class="error-text2">
{{ $t('components.500.errortext2') }}
<a @click="gotoPage">{{ $t('components.500.indexpage') }}</a>
{{ $t('components.500.continue') }}
</div>
</div>
</div>
</div>
</template>
<script lang="ts">
import { Environment } from '@/environments/environment';
import { Vue, Component } from 'vue-property-decorator';
@Component({})
export default class Error500 extends Vue {
/**
* 跳转页面
*
* @returns
* @memberof Error500
*/
public gotoPage() {
const length = this.$store.state.historyPathList.length;
if (length > 0) {
const path = this.$store.state.historyPathList[length - 1];
if (Object.is(path, this.$route.fullPath)) {
return;
}
const index = this.$store.state.pageTagList.findIndex((page: any) => Object.is(page.fullPath, path));
if (index >= 0) {
const page = this.$store.state.pageTagList[index];
this.$router.push({
path: page.path,
params: page.params,
query: page.query,
});
}
} else {
let path: string | null = window.sessionStorage.getItem(Environment.AppName);
if (path) {
this.$router.push({ path: path });
} else {
this.$router.push('/');
}
}
}
}
</script>
<style lang='less'>
@import './500.less';
</style>