Przeglądaj źródła

fix: remove company from login flow, use _User pointer in APIGAuth instead of Company

gangvy 5 miesięcy temu
rodzic
commit
b32db4603f
2 zmienionych plików z 4 dodań i 6 usunięć
  1. 2 2
      src/app/app.ts
  2. 2 4
      src/app/login-modal.component.ts

+ 2 - 2
src/app/app.ts

@@ -274,7 +274,7 @@ export class App implements OnInit {
       const query: any = {
         where: JSON.stringify({
           api: { __type: 'Pointer', className: 'APIG', objectId: apig },
-          company: { __type: 'Pointer', className: 'Company', objectId: user }
+          user: { __type: 'Pointer', className: '_User', objectId: user }
         }),
         limit: '1'
       };
@@ -301,7 +301,7 @@ export class App implements OnInit {
         },
         body: JSON.stringify({
           api: { __type: 'Pointer', className: 'APIG', objectId: apig },
-          company: { __type: 'Pointer', className: 'Company', objectId: user },
+          user: { __type: 'Pointer', className: '_User', objectId: user },
           count: 0,
           used: 0
         })

+ 2 - 4
src/app/login-modal.component.ts

@@ -245,8 +245,6 @@ export class LoginModalComponent {
   countdown = signal(0);
   countdownTimer: any = null;
 
-  private company = 'E4KpGvTEto';
-
   show(): void { this.visible = true; }
   hide(): void { this.visible = false; }
 
@@ -274,7 +272,7 @@ export class LoginModalComponent {
           'Content-Type': 'application/json',
           'X-Parse-Application-Id': APP_ID
         },
-        body: JSON.stringify({ company: this.company, mobile: this.phone })
+        body: JSON.stringify({ mobile: this.phone })
       });
       const result = await resp.json();
       if (result.error) {
@@ -306,7 +304,7 @@ export class LoginModalComponent {
 
     try {
       // 1. 调用登录接口获取 session token
-      const loginUrl = `${API_HOST}/api/auth/mobile?company=${this.company}&mobile=${this.phone}&code=${this.code}`;
+      const loginUrl = `${API_HOST}/api/auth/mobile?mobile=${this.phone}&code=${this.code}`;
       const resp = await fetch(loginUrl, {
         method: 'GET',
         headers: { 'X-Parse-Application-Id': APP_ID }