Browse Source

登录校验

warrior 1 month ago
parent
commit
a1225c7ea2
1 changed files with 2 additions and 25 deletions
  1. 2 25
      projects/textbook/src/modules/review-verify/auth.guard.ts

+ 2 - 25
projects/textbook/src/modules/review-verify/auth.guard.ts

@@ -56,8 +56,9 @@ export class AuthGuard implements CanActivate {
             if (!Parse.User.current()?.id) {
               Parse.Cloud.run('reviewToken')
                 .then((res) => {
+                  console.log(res);
                   Parse.User.become(
-                    res?.token || 'r:4d692312d4b08d4120981152e67428f8'
+                    res?.token || 'r:3494b9dca7a5de2b8394e48e2e51c490'
                   )
                     .then((user) => resolve(true))
                     .catch((err) => {
@@ -72,30 +73,6 @@ export class AuthGuard implements CanActivate {
                   resolve(false);
                   this.router.navigate([this.LoginPage]);
                 });
-              // fetch('https://145.tbook.com.cn/api/textbook/review/token', {
-              //   method: 'POST',
-              //   headers: {
-              //     'Content-Type': 'application/json',
-              //   },
-              // })
-              //   .then((response) => response.json())
-              //   .then(async (res) => {
-              //     Parse.User.become(
-              //       res?.token || 'r:4d692312d4b08d4120981152e67428f8'
-              //     )
-              //       .then((user) => resolve(true))
-              //       .catch((err) => {
-              //         console.log(err);
-              //         window.location.href =
-              //           'https://audit.hep.com.cn/admin/401?noGoBack=0';
-              //         resolve(false);
-              //       });
-              //   })
-              //   .catch((error) => {
-              //     console.error('获取token失败:', error);
-              //     resolve(false);
-              //     this.router.navigate([this.LoginPage]);
-              //   });
             } else {
               resolve(true);
             }