Browse Source

feat: guard with handmade

ryanemax 1 day ago
parent
commit
a45d060385
2 changed files with 7 additions and 1 deletions
  1. 1 1
      src/app/app.routes.ts
  2. 6 0
      src/app/wxwork-auth-guard.ts

+ 1 - 1
src/app/app.routes.ts

@@ -1,5 +1,5 @@
 import { Routes } from '@angular/router';
-import { WxworkAuthGuard } from 'fmode-ng/social'; 
+import { WxworkAuthGuard } from './wxwork-auth-guard'; 
 
 export const routes: Routes = [
   // 客服路由

+ 6 - 0
src/app/wxwork-auth-guard.ts

@@ -0,0 +1,6 @@
+import { CanActivateFn } from '@angular/router';
+import { checkWeworkLogin } from 'fmode-ng/core';
+
+export const WxworkAuthGuard: CanActivateFn = async (route, state) => {
+  return checkWeworkLogin(route);
+};