Przeglądaj źródła

极验注册失败提示

Michael Wang 4 lat temu
rodzic
commit
e7bfa06827
1 zmienionych plików z 24 dodań i 4 usunięć
  1. 24 4
      src/features/Login/GeeTest.vue

+ 24 - 4
src/features/Login/GeeTest.vue

@@ -52,10 +52,30 @@ export default {
         });
       }
 
-      const res = await this.$http.post("/api/ecs_core/verifyCode/register", {
-        user_id: localStorage.getItem("uuidForEcs"),
-        client_type: "Web",
-      });
+      let res = null;
+      try {
+        res = await this.$http.post("/api/ecs_core/verifyCode/register", {
+          user_id: localStorage.getItem("uuidForEcs"),
+          client_type: "Web",
+        });
+      } catch (error) {
+        createLog({
+          currentPage: "极验",
+          action: "register接口调用失败",
+          errorJSON: JSON.stringify(error, (key, value) =>
+            key === "token" ? "" : value
+          ),
+          errorName: error.name,
+          errorMessage: error.message,
+          errorStack: error.stack,
+        });
+        this.$Message.error({
+          content: "资源注册失败,请关闭程序,检查网络状况后重试。",
+          duration: 5 * 60,
+          closable: true,
+        });
+        return;
+      }
       // console.log(res);
       const data = res.data;
       if (!data.success) {