Parcourir la source

approuting代码优化

seimin il y a 1 an
Parent
commit
e62d8158cf
2 fichiers modifiés avec 32 ajouts et 17 suppressions
  1. 1 1
      proxy.conf.json
  2. 31 16
      src/app/app-routing.module.ts

+ 1 - 1
proxy.conf.json

@@ -1,6 +1,6 @@
1 1
 {
2 2
   "/service": {
3
-    "target": "http://192.168.4.241",
3
+    "target": "http://192.168.3.108",
4 4
     "logLevel": "debug",
5 5
     "changeOrigin": true,
6 6
     "pathRewrite": {

+ 31 - 16
src/app/app-routing.module.ts

@@ -1,68 +1,83 @@
1 1
 import { NgModule } from '@angular/core';
2 2
 import { Routes, RouterModule } from '@angular/router';
3 3
 
4
-import { NurseGuard } from './guard/nurse.guard';//护士端权限
5
-import { FuwutaiGuard } from './guard/fuwutai.guard';//服务台权限
6
-import { MainGuard } from './guard/main.guard';//管理端权限
7
-import { PharmacyGuard } from './guard/pharmacy.guard';//药房端权限
8
-import { SpecimenView2Guard } from './guard/SpecimenView2Guard.guard';//标本视图权限
4
+// 护士端权限
5
+import { NurseGuard } from './guard/nurse.guard';
6
+// 服务台权限
7
+import { FuwutaiGuard } from './guard/fuwutai.guard';
8
+// 管理端权限
9
+import { MainGuard } from './guard/main.guard';
10
+// 药房端权限
11
+import { PharmacyGuard } from './guard/pharmacy.guard';
12
+// 标本视图权限
13
+import { SpecimenView2Guard } from './guard/SpecimenView2Guard.guard';
14
+// 全局业务查看权限
9 15
 import { DisinfectionSupplyGuard } from './guard/DisinfectionSupplyGuard.guard';
16
+
10 17
 const routes: Routes = [
18
+  // 默认
11 19
   {
12 20
     path: '',
13 21
     redirectTo: 'login',
14 22
     pathMatch: 'full'
15 23
   },
24
+  // 登录
16 25
   {
17
-    // 登录
18 26
     path: 'login',
19 27
     loadChildren: () => import('./views/login/login.module').then(m => m.LoginModule)
20 28
   },
29
+  // 管理端
21 30
   {
22
-    //管理端
23 31
     path: 'main',
24 32
     loadChildren: () => import('./views/main/main.module').then(m => m.MainModule),
25 33
     canActivate: [MainGuard],
26 34
   },
35
+  // 调度台
27 36
   {
28
-    //调度台
29 37
     path: 'dispatchingDesk',
30 38
     loadChildren: () => import('./views/fuwutai/fuwutai.module').then(m => m.FuwutaiModule),
31 39
     canActivate: [FuwutaiGuard],
32 40
   },
41
+  // 护士端
33 42
   {
34
-    // 护士端
35 43
     path: 'nurse',
36 44
     loadChildren: () => import('./views/hushijiandan/hushijiandan.module').then(m => m.HushijiandanModule),
37 45
     canActivate: [NurseGuard],
38 46
   },
47
+  // 药房端
39 48
   {
40
-    path: 'pharmacy',//药房端
49
+    path: 'pharmacy',
41 50
     loadChildren: () => import('./views/pharmacy/pharmacy.module').then(m => m.PharmacyModule),
42 51
     canActivate: [PharmacyGuard]
43 52
   },
53
+  // 药房端2
44 54
   {
45
-    path: 'pharmacy2',//药房端2
55
+    path: 'pharmacy2',
46 56
     loadChildren: () => import('./views/pharmacy2/pharmacy2.module').then(m => m.Pharmacy2Module),
47 57
     canActivate: [PharmacyGuard]
48 58
   },
59
+  // 标本视图
49 60
   {
50
-    path: 'specimenView2',//标本视图
61
+    path: 'specimenView2',
51 62
     loadChildren: () => import('./views/specimen-view2/specimen-view2.module').then(m => m.SpecimenView2Module),
52 63
     canActivate: [SpecimenView2Guard]
53 64
   },
65
+  // 全局业务查看
54 66
   {
55
-    path: 'disinfectionSupply',//全局业务查看
67
+    path: 'disinfectionSupply',
56 68
     loadChildren: () => import('./views/disinfection-supply/disinfection-supply.module').then(m => m.DisinfectionSupplyModule),
57 69
     canActivate: [DisinfectionSupplyGuard]
58 70
   },
71
+  // 问卷预览
59 72
   {
60
-    // 问卷预览
61 73
     path: "preview",
62 74
     loadChildren: () => import("./views/preview/preview.module").then((m) => m.PreviewModule),
63 75
   },
64
-  { path: '**', redirectTo: 'main/home' }
65
-
76
+  // 管理端首页
77
+  {
78
+    path: '**',
79
+    redirectTo: 'main/home'
80
+  },
66 81
 ];
67 82
 
68 83
 @NgModule({