licailing 5 лет назад
Родитель
Сommit
4887cdd458
1 измененных файлов с 43 добавлено и 43 удалено
  1. 43 43
      src/main/h5/src/views/login.vue

+ 43 - 43
src/main/h5/src/views/login.vue

@@ -74,49 +74,49 @@ export default {
         message: "加载中...",
         forbidClick: true
       });
-    //   this.$http
-    //     .get("/sms/verify", {
-    //       phone: this.ruleForm.phone,
-    //       code: this.ruleForm.code
-    //     })
-    //     .then(() => {
-    //       return this.$http.post("/auth/phoneLogin", {
-    //         phone: this.ruleForm.phone
-    //       });
-    //     })
-    //     .catch(e => {
-    //       this.$toast(e.error || "登录失败");
-    //       return Promise.reject();
-    //     })
-    //     .then(res => {
-    //       localStorage.setItem("token", res);
-    //       return this.$store.dispatch("getUserInfo");
-    //     })
-    //     .then(() => {
-    //       this.$toast.clear();
-    //       this.$router.replace({ path: "/" });
-    //     })
-    //     .catch(e => {
-    //       if (e) {
-    //         this.$toast(e.error);
-    //       }
-    //     });
-        this.$http
-            .post("/auth/phoneLogin", {
-            phone: this.ruleForm.phone
-            })
-            .then(res => {
-            localStorage.setItem("token", res);
-            return this.$store.dispatch("getUserInfo");
-            })
-            .then(() => {
-            this.$toast.clear();
-            this.$router.replace({ path: "/" });
-            })
-            .catch(e => {
-            this.$toast.clear();
-            this.$toast(e.error || "登录失败");
-            });
+      //   this.$http
+      //     .get("/sms/verify", {
+      //       phone: this.ruleForm.phone,
+      //       code: this.ruleForm.code
+      //     })
+      //     .then(() => {
+      //       return this.$http.post("/auth/phoneLogin", {
+      //         phone: this.ruleForm.phone
+      //       });
+      //     })
+      //     .catch(e => {
+      //       this.$toast(e.error || "登录失败");
+      //       return Promise.reject();
+      //     })
+      //     .then(res => {
+      //       localStorage.setItem("token", res);
+      //       return this.$store.dispatch("getUserInfo");
+      //     })
+      //     .then(() => {
+      //       this.$toast.clear();
+      //       this.$router.replace({ path: "/" });
+      //     })
+      //     .catch(e => {
+      //       if (e) {
+      //         this.$toast(e.error);
+      //       }
+      //     });
+      this.$http
+        .post("/auth/phoneLogin", {
+        phone: this.ruleForm.phone
+        })
+        .then(res => {
+        localStorage.setItem("token", res);
+        return this.$store.dispatch("getUserInfo");
+        })
+        .then(() => {
+        this.$toast.clear();
+        this.$router.replace({ path: "/" });
+        })
+        .catch(e => {
+        this.$toast.clear();
+        this.$toast(e.error || "登录失败");
+        });
     },
     sendSms() {
       if (!this.ruleForm.phone || !/^1[3-9]\d{9}$/.test(this.ruleForm.phone)) {