提交 a024b221 编写于 作者: Neuromancer255's avatar Neuromancer255

Revert "错误提示中转页解决模态不能正确显示错误页"

This reverts commit 48b58e78.
上级 a819a3fe
......@@ -109,9 +109,5 @@ export const AppComponents = {
v.component('app-list-index-text',() => import('@/components/app-list-index-text/app-list-index-text.vue'));
// 富文本(模态)
v.component('app-rich-text',() => import('@/components/app-rich-text/app-rich-text.vue'));
// 500错误提示页
v.component('app-500',() => import('@/components/500/500.vue'));
// 404错误提示页
v.component('app-404',() => import('@/components/404/404.vue'));
},
};
\ No newline at end of file
......@@ -37,13 +37,18 @@ export default class App404 extends Vue {
* 返回上一步
*/
public back() {
this.$emit("close",['back'])
if (window.history.length <= 1) {
this.$router.push({ path: "/" });
return false;
} else {
this.$router.go(-1);
}
}
/**
* 返回首页
*/
public backindex() {
this.$emit("close",['goIndex'])
this.$router.push({ path: "/" });
}
}
</script>
......
......@@ -37,13 +37,18 @@ export default class App404 extends Vue {
* 返回上一步
*/
public back() {
this.$emit("close",['back'])
if (window.history.length <= 1) {
this.$router.push({ path: "/" });
return false;
} else {
this.$router.go(-1);
}
}
/**
* 返回首页
*/
public backindex() {
this.$emit("close",['goIndex'])
this.$router.push({ path: "/" });
}
}
</script>
......
<template>
<div></div>
</template>
<script lang="ts">
import {
Vue,
Component,
Prop,
Provide,
Emit,
Watch
} from "vue-property-decorator";
@Component({
components: {}
})
export default class MiddleMan extends Vue{
public created(){
let errorPage = this.$route.params.errorPage;
switch(Number(errorPage)){
case 404:this.openPopupModal({ viewname: 'app-404', title: '404'}, {}, {});break;
case 500:this.openPopupModal({ viewname: 'app-500', title: '500'}, {}, {});break;
}
}
/**
* 模态打开错误提示页面
*
* @type {string}
* @memberof AppRichTextEditor
*/
private async openPopupModal(view: any, context: any, param: any): Promise<any> {
const result: any = await this.$appmodal.openModal(view, context, param);
if (result || Object.is(result.ret, 'OK')) {
if (result.datas[0] === 'back') {
if (window.history.length <= 1) {
this.$router.push({ path: "/" });
} else {
this.$router.go(-1);
}
}
if (result.datas[0] === 'goIndex') {
this.$router.push({ path: "/" });
}
}
}
}
</script>
<style>
</style>
\ No newline at end of file
......@@ -114,10 +114,10 @@ export class Interceptors {
}
if (res.status === 404) {
Loading.hidden();
this.router.push({ name:'errorTransfer', params:{errorPage:res.status} });
this.router.push({ path: '/404' });
} else if (res.status === 500) {
Loading.hidden();
this.router.push({ name:'errorTransfer', params:{errorPage:res.status} });
this.router.push({ path: '/500' });
}
return Promise.reject(res);
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册