소스 검색

feat: guard with handmade

ryanemax 1 일 전
부모
커밋
a45d060385
2개의 변경된 파일7개의 추가작업 그리고 1개의 파일을 삭제
  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);
+};