自动登录、重新开始练习、各种币种间的交易转换

master
unclekh 5 years ago
parent 3a43e2e937
commit e8b540b57f
  1. 33
      src/pages/yyyflogin.vue

@ -18,7 +18,9 @@
data() {
return {
loading: null
loading: null,
tel:null,
pass:null
};
},
@ -51,7 +53,7 @@
});
},
endLoading: function () { //使Element loading-close
this.loading.close()
this.loading.close();
},
parseUrl: function () {
let params = {}; //
@ -84,17 +86,17 @@
},
sign(params) {
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);
}
});
},
login(num, pass) {
debugger;
login() {
signIn({
tel: num,
password: pass,
tel: this.tel,
password: this.pass,
}).then(res => {
// console.log(res);
if (res.data.code === 200) {
@ -103,7 +105,6 @@
// Cookie.set('phoneNum',num)
// Cookie.set('password',pass)
// }
this.loading = false;
//tokencookie
// Cookie.set('token', res.data.data.token);
localStorage.setItem('token', res.data.data.token);
@ -128,8 +129,6 @@
},
loginFromYyyf: function (params) {
signInYyyf(params).then(res => {
debugger;
// console.log(res);
if (res.data.code === 200) {
let status = res.data.data.status;
if (status == 1) {
@ -138,22 +137,24 @@
localStorage.setItem('yyyfToken', res.data.data.yyyfUserToken);
let code = res.data.data.code;
let tel = res.data.data.tel;
let password = res.data.data.password;
this.tel = res.data.data.tel;
this.pass = res.data.data.password;
//
if (code != undefined && code != '') {
let signParams = {
tel: tel,
tel: this.tel,
nickName: res.data.data.nickName,
code: res.data.data.code,
password: password,
password: this.pass,
internationalCode: null,
invitationCode: '',
}
this.sign(signParams);
}else{
this.login();
}
this.login(tel, password);
} else {
this.$message.warning({

Loading…
Cancel
Save