|
|
@ -18,7 +18,9 @@ |
|
|
|
|
|
|
|
|
|
|
|
data() { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
return { |
|
|
|
loading: null |
|
|
|
loading: null, |
|
|
|
|
|
|
|
tel:null, |
|
|
|
|
|
|
|
pass:null |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
@ -51,7 +53,7 @@ |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
endLoading: function () { //使用Element loading-close 方法 |
|
|
|
endLoading: function () { //使用Element loading-close 方法 |
|
|
|
this.loading.close() |
|
|
|
this.loading.close(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
parseUrl: function () { |
|
|
|
parseUrl: function () { |
|
|
|
let params = {}; //定义数组 |
|
|
|
let params = {}; //定义数组 |
|
|
@ -84,17 +86,17 @@ |
|
|
|
}, |
|
|
|
}, |
|
|
|
sign(params) { |
|
|
|
sign(params) { |
|
|
|
signUp(params).then(res => { |
|
|
|
signUp(params).then(res => { |
|
|
|
// console.log(res.data) |
|
|
|
if (res.data.code === 200) { |
|
|
|
if (res.data.code !== 200) { |
|
|
|
this.login(); |
|
|
|
|
|
|
|
}else{ |
|
|
|
this.$message.warning(res.data.msg); |
|
|
|
this.$message.warning(res.data.msg); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
login(num, pass) { |
|
|
|
login() { |
|
|
|
debugger; |
|
|
|
|
|
|
|
signIn({ |
|
|
|
signIn({ |
|
|
|
tel: num, |
|
|
|
tel: this.tel, |
|
|
|
password: pass, |
|
|
|
password: this.pass, |
|
|
|
}).then(res => { |
|
|
|
}).then(res => { |
|
|
|
// console.log(res); |
|
|
|
// console.log(res); |
|
|
|
if (res.data.code === 200) { |
|
|
|
if (res.data.code === 200) { |
|
|
@ -103,7 +105,6 @@ |
|
|
|
// Cookie.set('phoneNum',num) |
|
|
|
// Cookie.set('phoneNum',num) |
|
|
|
// Cookie.set('password',pass) |
|
|
|
// Cookie.set('password',pass) |
|
|
|
// } |
|
|
|
// } |
|
|
|
this.loading = false; |
|
|
|
|
|
|
|
//保存登录的token到cookie |
|
|
|
//保存登录的token到cookie |
|
|
|
// Cookie.set('token', res.data.data.token); |
|
|
|
// Cookie.set('token', res.data.data.token); |
|
|
|
localStorage.setItem('token', res.data.data.token); |
|
|
|
localStorage.setItem('token', res.data.data.token); |
|
|
@ -128,8 +129,6 @@ |
|
|
|
}, |
|
|
|
}, |
|
|
|
loginFromYyyf: function (params) { |
|
|
|
loginFromYyyf: function (params) { |
|
|
|
signInYyyf(params).then(res => { |
|
|
|
signInYyyf(params).then(res => { |
|
|
|
debugger; |
|
|
|
|
|
|
|
// console.log(res); |
|
|
|
|
|
|
|
if (res.data.code === 200) { |
|
|
|
if (res.data.code === 200) { |
|
|
|
let status = res.data.data.status; |
|
|
|
let status = res.data.data.status; |
|
|
|
if (status == 1) { |
|
|
|
if (status == 1) { |
|
|
@ -138,22 +137,24 @@ |
|
|
|
localStorage.setItem('yyyfToken', res.data.data.yyyfUserToken); |
|
|
|
localStorage.setItem('yyyfToken', res.data.data.yyyfUserToken); |
|
|
|
|
|
|
|
|
|
|
|
let code = res.data.data.code; |
|
|
|
let code = res.data.data.code; |
|
|
|
let tel = res.data.data.tel; |
|
|
|
this.tel = res.data.data.tel; |
|
|
|
let password = res.data.data.password; |
|
|
|
this.pass = res.data.data.password; |
|
|
|
//注册 |
|
|
|
//注册 |
|
|
|
if (code != undefined && code != '') { |
|
|
|
if (code != undefined && code != '') { |
|
|
|
let signParams = { |
|
|
|
let signParams = { |
|
|
|
tel: tel, |
|
|
|
tel: this.tel, |
|
|
|
nickName: res.data.data.nickName, |
|
|
|
nickName: res.data.data.nickName, |
|
|
|
code: res.data.data.code, |
|
|
|
code: res.data.data.code, |
|
|
|
password: password, |
|
|
|
password: this.pass, |
|
|
|
internationalCode: null, |
|
|
|
internationalCode: null, |
|
|
|
invitationCode: '', |
|
|
|
invitationCode: '', |
|
|
|
} |
|
|
|
} |
|
|
|
this.sign(signParams); |
|
|
|
this.sign(signParams); |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
this.login(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.login(tel, password); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.$message.warning({ |
|
|
|
this.$message.warning({ |
|
|
|