From 629e34b635ab0d40e17a1baa09c67ffa7fcdd75c Mon Sep 17 00:00:00 2001
From: zzzz <690498789@qq.com>
Date: Mon, 22 Apr 2024 19:12:39 +0800
Subject: [PATCH] first

---
 src/page/register/index.vue |   51 ++++---------------------
 src/router/router.js        |    3 +
 src/request/axios.js        |    1 
 src/API/login.js            |   14 +++----
 4 files changed, 18 insertions(+), 51 deletions(-)

diff --git a/src/API/login.js b/src/API/login.js
index 7d81bb5..8c18c82 100644
--- a/src/API/login.js
+++ b/src/API/login.js
@@ -27,14 +27,12 @@
 //注册用户
 ///
 const registerUser = (params) => {
-  return httpJson(
-    {
-      url: "/api/localuser!registerNoVerifcode.action",
-      method: "get",
-      isLoading: true,
-    },
-    params
-  );
+  return requestHttp({
+    url: "api/user/register",
+    method: "post",
+    isLoading: true,
+    data: objectToFormData(params),
+  });
 };
 //登录
 const loginUser = (params) => {
diff --git a/src/page/register/index.vue b/src/page/register/index.vue
index 895f51e..f3355e1 100644
--- a/src/page/register/index.vue
+++ b/src/page/register/index.vue
@@ -253,52 +253,19 @@
 
     async registerApi() {
       this.$store.state.user.userInfo.token = undefined;
-      await AxiosuserCenter.invitationCode({
-        code: this.form.usercode,
-      });
+
       Axios.registerUser({
-        username: this.form.email,
-        password: this.form.password,
-        re_password: this.form.rePassword,
+        ...this.form,
         type: 2,
-        usercode: this.form.usercode,
       })
         .then((res) => {
-          this.GET_USERINFO(res.data);
-          this.bindEmail(res.data.token)
-            .then((val) => {
-              // console.log(val);
-              Axios.registerTest({
-                username: this.form.username,
-                phone: this.form.phone,
-                email: this.form.email,
-                tokne: res.data.token,
-              })
-                .then((data) => {
-                  this.$toast(this.$t("注册成功"));
-                  setTimeout(() => {
-                    this.$router.push("login");
-                  }, 1000);
-                })
-                .catch((error) => {
-                  this.codeButTexst = "发送验证码";
-                  clearInterval(this.tiem);
-                  if (error.code === "ECONNABORTED") {
-                    this.$toast(this.$t("网络超时!"));
-                  } else if (error.msg !== undefined) {
-                    this.$toast(this.$t(error.msg));
-                  }
-                });
-            })
-            .catch((error) => {
-              this.codeButTexst = "发送验证码";
-              clearInterval(this.tiem);
-              if (error.code === "ECONNABORTED") {
-                this.$toast(this.$t("网络超时!"));
-              } else if (error.msg !== undefined) {
-                this.$toast(this.$t(error.msg));
-              }
-            });
+          console.log(res, "=======");
+          // this.GET_USERINFO(res.data);
+          // this.bindEmail(res.data.token);
+          this.$toast(this.$t("注册成功"));
+          setTimeout(() => {
+            this.$router.push("login");
+          }, 1000);
         })
         .catch((error) => {
           this.codeButTexst = "发送验证码";
diff --git a/src/request/axios.js b/src/request/axios.js
index 1f8e7cf..8741de4 100644
--- a/src/request/axios.js
+++ b/src/request/axios.js
@@ -60,6 +60,7 @@
     instance.interceptors.request.use(
       (config) => {
         const arr = urlKyc.filter((item) => item === url);
+
         if (arr.length !== 0 && store.state.user.kyc !== 2) {
           return Toast.fail(i18n.t("请先实名认证!"));
         }
diff --git a/src/router/router.js b/src/router/router.js
index 171e0eb..0729e6f 100644
--- a/src/router/router.js
+++ b/src/router/router.js
@@ -1377,7 +1377,8 @@
     // 判断该路由是否需要登录权限
     if (store.state.user.userInfo.token) {
       // 通过vuex state获取当前的token是否存在
-      if (to.meta.kyc && store.state.user.userInfo.kyc !== 2) {
+
+      if (to.meta.kyc && store.state.user.kyc !== 2) {
         return Toast.fail(i18n.t("请先实名认证!"));
       }
       if (to.meta.isMerchant) {

--
Gitblit v1.9.3