|
|
@@ -74,10 +74,45 @@ export default {
|
|
|
message: "加载中...",
|
|
|
forbidClick: true
|
|
|
});
|
|
|
+ // this.$http
|
|
|
+ // .post("/programme/getAuth", {
|
|
|
+ // phone: this.ruleForm.phone,
|
|
|
+ // id: this.$route.query.programmeId
|
|
|
+ // })
|
|
|
+ // .then(res => {
|
|
|
+ // window.localStorage.setItem("loginPhone", res.phone);
|
|
|
+ // if (res.token) {
|
|
|
+ // window.localStorage.setItem("loginPhoneToken", res.token);
|
|
|
+ // localStorage.setItem("token", res.token);
|
|
|
+ // return this.$store.dispatch("getUserInfo");
|
|
|
+ // } else {
|
|
|
+ // return Promise.resolve();
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // .then(() => {
|
|
|
+ // this.$toast.clear();
|
|
|
+ // this.$router.replace({ path: "/home", query: this.$route.query });
|
|
|
+ // })
|
|
|
+ // .catch(e => {
|
|
|
+ // if (e) {
|
|
|
+ // this.$toast(e.error);
|
|
|
+ // this.isSend = false;
|
|
|
+ // this.ruleForm = {
|
|
|
+ // phone: "",
|
|
|
+ // code: ""
|
|
|
+ // };
|
|
|
+ // }
|
|
|
+ // });
|
|
|
this.$http
|
|
|
- .post("/programme/getAuth", {
|
|
|
+ .get("/sms/verify", {
|
|
|
phone: this.ruleForm.phone,
|
|
|
- id: this.$route.query.programmeId
|
|
|
+ code: this.ruleForm.code
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ return this.$http.post("/programme/getAuth", {
|
|
|
+ phone: this.ruleForm.phone,
|
|
|
+ id: this.$route.query.programmeId
|
|
|
+ });
|
|
|
})
|
|
|
.then(res => {
|
|
|
window.localStorage.setItem("loginPhone", res.phone);
|
|
|
@@ -104,34 +139,6 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
// this.$http
|
|
|
- // .get("/sms/verify", {
|
|
|
- // phone: this.ruleForm.phone,
|
|
|
- // code: this.ruleForm.code
|
|
|
- // })
|
|
|
- // .then(() => {
|
|
|
- // return this.$http.post("/performanceApply/getAuth", {
|
|
|
- // phone: this.ruleForm.phone,
|
|
|
- // id: this.$route.query.performanceApplyId
|
|
|
- // });
|
|
|
- // })
|
|
|
- // .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
|
|
|
// })
|
|
|
@@ -154,18 +161,18 @@ export default {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- // this.$http
|
|
|
- // .get("/sms/sendVerify", {
|
|
|
- // phone: this.ruleForm.phone
|
|
|
- // })
|
|
|
- // .then(res => {
|
|
|
- // this.$toast.success("发送成功");
|
|
|
- this.isSend = true;
|
|
|
- this.changeTime(60);
|
|
|
- // })
|
|
|
- // .catch(e => {
|
|
|
- // this.$toast(e.error);
|
|
|
- // });
|
|
|
+ this.$http
|
|
|
+ .get("/sms/sendVerify", {
|
|
|
+ phone: this.ruleForm.phone
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ this.$toast.success("发送成功");
|
|
|
+ this.isSend = true;
|
|
|
+ this.changeTime(60);
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ this.$toast(e.error);
|
|
|
+ });
|
|
|
},
|
|
|
changeTime(num) {
|
|
|
this.num = num;
|