|
|
|
@ -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,7 +172,18 @@ export default {
|
|
|
|
|
password: "fakePassword",
|
|
|
|
|
md5_password: md5(this.password).toString(),
|
|
|
|
|
})
|
|
|
|
|
.then((data) => {
|
|
|
|
|
.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);
|
|
|
|
@ -186,12 +192,6 @@ export default {
|
|
|
|
|
this.updateData({ key: "user", value: data.profile });
|
|
|
|
|
this.afterLogin();
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch((error) => {
|
|
|
|
|
this.processing = false;
|
|
|
|
|
alert(error);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|