|
@@ -81,4 +81,20 @@ const routes: Routes = [
|
|
|
<ion-icon aria-hidden="true" name="person"></ion-icon>
|
|
|
<ion-label>我的</ion-label>
|
|
|
</ion-tab-button>
|
|
|
+```
|
|
|
+
|
|
|
+# 路由守卫 AuthGuard用法
|
|
|
+
|
|
|
+``` ts
|
|
|
+// 引用路由守卫
|
|
|
+import { authGuard } from 'src/modules/user/auth.guard';
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+{
|
|
|
+ path: 'tab2',
|
|
|
+ // 此处增加路由守卫
|
|
|
+ canActivate:[authGuard],
|
|
|
+ loadChildren: () => import('../../modules/contact/contact-list/contact-list.module').then(mod => mod.ContactListPageModule)
|
|
|
+ },
|
|
|
```
|