From c34c87ff6bf310e461ae27c1988d39baef208da8 Mon Sep 17 00:00:00 2001
From: zzzz <690498789@qq.com>
Date: Wed, 17 Apr 2024 16:25:28 +0800
Subject: [PATCH] first

---
 src/page/register/index.vue |   52 +++++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 45 insertions(+), 7 deletions(-)

diff --git a/src/page/register/index.vue b/src/page/register/index.vue
index 181c795..a5745f4 100644
--- a/src/page/register/index.vue
+++ b/src/page/register/index.vue
@@ -262,16 +262,54 @@
       }
     },
     async registerApi() {
-      Axios.registerTest(this.form)
+      this.$store.state.user.userInfo.token = undefined;
+      Axios.registerUser({
+        username: this.form.email,
+        password: this.form.password,
+        re_password: this.form.rePassword,
+        type: 2,
+        usercode: this.form.usercode,
+      })
         .then((res) => {
-          console.log(44444, res);
-          // this.GET_USERINFO(res.data);
-          this.$toast(this.$t("注册成功"));
-          setTimeout(() => {
-            this.$router.push("login");
-          }, 1000);
+          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));
+              }
+            });
         })
         .catch((error) => {
+          this.codeButTexst = "发送验证码";
+          clearInterval(this.tiem);
           if (error.code === "ECONNABORTED") {
             this.$toast(this.$t("网络超时!"));
           } else if (error.msg !== undefined) {

--
Gitblit v1.9.3