Merge pull request #62 from njzydark/master

fix: set cookie when login with phone
master
qier222 4 years ago committed by GitHub
commit 962b81a628
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -160,12 +160,7 @@ export default {
password: "fakePassword",
md5_password: md5(this.password).toString(),
})
.then((data) => {
if (data.code !== 502) {
this.updateData({ key: "user", value: data.profile });
this.afterLogin();
}
})
.then(this.handleLoginResponse)
.catch((error) => {
this.processing = false;
alert(error);
@ -177,22 +172,27 @@ export default {
password: "fakePassword",
md5_password: md5(this.password).toString(),
})
.then((data) => {
// MUSIC_U cookie
// 301
const MUSIC_U = getMusicU(data.cookie);
setMusicU("MUSIC_U", MUSIC_U);
if (data.code !== 502) {
this.updateData({ key: "user", value: data.profile });
this.afterLogin();
}
})
.then(this.handleLoginResponse)
.catch((error) => {
this.processing = false;
alert(error);
});
}
},
handleLoginResponse(data) {
if (!data) {
this.processing = false;
return;
}
// MUSIC_U cookie
// 301
const MUSIC_U = getMusicU(data.cookie);
setMusicU("MUSIC_U", MUSIC_U);
if (data.code !== 502) {
this.updateData({ key: "user", value: data.profile });
this.afterLogin();
}
},
},
};
</script>

Loading…
Cancel
Save