|
|
@@ -74,33 +74,33 @@ 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
|
|
|
+ .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
|