Browse Source

更新错误提示问题

warrior 2 weeks ago
parent
commit
6a63e12c29

+ 7 - 7
projects/live-app/src/modules/login/invite/invite.component.ts

@@ -362,13 +362,13 @@ export class InviteComponent implements OnInit {
           });
           await alert.present();
         } else {
-          const toast = await this.toastController.create({
-            // 接口返回的错误,提示用户
-            message: res.mess,
-            color: 'danger',
-            duration: 1000,
-          });
-          toast.present();
+          // const toast = await this.toastController.create({
+          //   // 接口返回的错误,提示用户
+          //   message: res.mess,
+          //   color: 'danger',
+          //   duration: 1000,
+          // });
+          // toast.present();
         }
       });
   }

+ 12 - 11
projects/live-app/src/modules/login/login.component.ts

@@ -569,12 +569,12 @@ export class LoginComponent implements OnInit {
         catchError(async (e) => {
           // 显示报错
           const toast = await this.toastController.create({
-            message: e.message,
+            message: e?.error.mess || e?.error.message,
             color: 'danger',
             duration: 1000,
           });
           toast.present();
-          console.log(e);
+          console.log(e?.error.mess);
           return;
         })
       )
@@ -595,15 +595,16 @@ export class LoginComponent implements OnInit {
             invite: '',
           };
           this.status = 'login';
-        } else {
-          const toast = await this.toastController.create({
-            // 接口返回的错误,提示用户
-            message: res.mess,
-            color: 'danger',
-            duration: 1000,
-          });
-          toast.present();
-        }
+        } 
+        // else {
+        //   const toast = await this.toastController.create({
+        //     // 接口返回的错误,提示用户
+        //     message: res?.error.mess,
+        //     color: 'danger',
+        //     duration: 1000,
+        //   });
+        //   toast.present();
+        // }
       });
   }
 }