From 95eded49bf049aa290a76ec2da2a682910c6a812 Mon Sep 17 00:00:00 2001
From: yuanye <418471657@qq.com>
Date: Wed, 22 May 2024 11:53:46 +0800
Subject: [PATCH] 1
---
src/app/app.routes.ts | 10 +++++
src/app/pages/error/error.module.ts | 12 +++++
src/app/pages/error/error.routes.ts | 8 ++++
.../error/error401/error401.component.html | 5 +++
.../error/error401/error401.component.less | 0
.../error/error401/error401.component.ts | 44 +++++++++++++++++++
.../error/error403/error403.component.html | 1 +
.../error/error403/error403.component.less | 0
.../error/error403/error403.component.spec.ts | 23 ++++++++++
.../error/error403/error403.component.ts | 12 +++++
.../error/error404/error404.component.html | 1 +
.../error/error404/error404.component.less | 0
.../error/error404/error404.component.spec.ts | 23 ++++++++++
.../error/error404/error404.component.ts | 12 +++++
.../error/error500/error500.component.html | 1 +
.../error/error500/error500.component.less | 0
.../error/error500/error500.component.spec.ts | 23 ++++++++++
.../error/error500/error500.component.ts | 12 +++++
src/app/utils/Interceptor.service.ts | 1 +
src/environments/environment.dev.ts | 2 +-
20 files changed, 189 insertions(+), 1 deletion(-)
create mode 100644 src/app/pages/error/error.module.ts
create mode 100644 src/app/pages/error/error.routes.ts
create mode 100644 src/app/pages/error/error401/error401.component.html
create mode 100644 src/app/pages/error/error401/error401.component.less
create mode 100644 src/app/pages/error/error401/error401.component.ts
create mode 100644 src/app/pages/error/error403/error403.component.html
create mode 100644 src/app/pages/error/error403/error403.component.less
create mode 100644 src/app/pages/error/error403/error403.component.spec.ts
create mode 100644 src/app/pages/error/error403/error403.component.ts
create mode 100644 src/app/pages/error/error404/error404.component.html
create mode 100644 src/app/pages/error/error404/error404.component.less
create mode 100644 src/app/pages/error/error404/error404.component.spec.ts
create mode 100644 src/app/pages/error/error404/error404.component.ts
create mode 100644 src/app/pages/error/error500/error500.component.html
create mode 100644 src/app/pages/error/error500/error500.component.less
create mode 100644 src/app/pages/error/error500/error500.component.spec.ts
create mode 100644 src/app/pages/error/error500/error500.component.ts
diff --git a/src/app/app.routes.ts b/src/app/app.routes.ts
index 74f2315..d692fd2 100644
--- a/src/app/app.routes.ts
+++ b/src/app/app.routes.ts
@@ -1,6 +1,7 @@
import { Routes } from '@angular/router';
import {IndexComponent} from "./pages/body/index/index.component";
import {InitGuardService} from "./utils/initGuard.service";
+import {ERROR_ROUTES} from "./pages/error/error.routes";
export const routes: Routes = [
{path: '', pathMatch: 'full', redirectTo: 'admin/index'},
{
@@ -54,6 +55,15 @@ export const routes: Routes = [
loadChildren: () => import('./pages/audit/audit.routes').then(m => m.AUDIT_ROUTES),
canActivate: [InitGuardService]
},
+ {
+ path: 'error',
+ children: [
+ {path: '', loadChildren: () => import('./pages/error/error.routes').then(m => m.ERROR_ROUTES)},
+ ]
+ },
+ {
+ // path: '**', component: Error404Component
+ },
]
}
];
diff --git a/src/app/pages/error/error.module.ts b/src/app/pages/error/error.module.ts
new file mode 100644
index 0000000..d4b3183
--- /dev/null
+++ b/src/app/pages/error/error.module.ts
@@ -0,0 +1,12 @@
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+
+
+
+@NgModule({
+ declarations: [],
+ imports: [
+ CommonModule
+ ]
+})
+export class ErrorModule { }
diff --git a/src/app/pages/error/error.routes.ts b/src/app/pages/error/error.routes.ts
new file mode 100644
index 0000000..f440676
--- /dev/null
+++ b/src/app/pages/error/error.routes.ts
@@ -0,0 +1,8 @@
+import { Routes } from '@angular/router';
+
+
+
+export const ERROR_ROUTES: Routes = [
+
+
+];
diff --git a/src/app/pages/error/error401/error401.component.html b/src/app/pages/error/error401/error401.component.html
new file mode 100644
index 0000000..727e860
--- /dev/null
+++ b/src/app/pages/error/error401/error401.component.html
@@ -0,0 +1,5 @@
+
error403 works!
diff --git a/src/app/pages/error/error403/error403.component.less b/src/app/pages/error/error403/error403.component.less new file mode 100644 index 0000000..e69de29 diff --git a/src/app/pages/error/error403/error403.component.spec.ts b/src/app/pages/error/error403/error403.component.spec.ts new file mode 100644 index 0000000..b89455c --- /dev/null +++ b/src/app/pages/error/error403/error403.component.spec.ts @@ -0,0 +1,23 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { Error403Component } from './error403.component'; + +describe('Error403Component', () => { + let component: Error403Component; + let fixture: ComponentFixtureerror404 works!
diff --git a/src/app/pages/error/error404/error404.component.less b/src/app/pages/error/error404/error404.component.less new file mode 100644 index 0000000..e69de29 diff --git a/src/app/pages/error/error404/error404.component.spec.ts b/src/app/pages/error/error404/error404.component.spec.ts new file mode 100644 index 0000000..3cf2c6b --- /dev/null +++ b/src/app/pages/error/error404/error404.component.spec.ts @@ -0,0 +1,23 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { Error404Component } from './error404.component'; + +describe('Error404Component', () => { + let component: Error404Component; + let fixture: ComponentFixtureerror500 works!
diff --git a/src/app/pages/error/error500/error500.component.less b/src/app/pages/error/error500/error500.component.less new file mode 100644 index 0000000..e69de29 diff --git a/src/app/pages/error/error500/error500.component.spec.ts b/src/app/pages/error/error500/error500.component.spec.ts new file mode 100644 index 0000000..c206cc3 --- /dev/null +++ b/src/app/pages/error/error500/error500.component.spec.ts @@ -0,0 +1,23 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { Error500Component } from './error500.component'; + +describe('Error500Component', () => { + let component: Error500Component; + let fixture: ComponentFixture