feat: login set music_u

This commit is contained in:
kunkka 2020-10-31 18:12:45 +08:00
parent 8c17b70f3c
commit 6663d00b52
2 changed files with 21 additions and 0 deletions

View file

@ -89,6 +89,7 @@ import { loginWithPhone, loginWithEmail } from "@/api/auth";
import md5 from "crypto-js/md5";
import { mapMutations } from "vuex";
import { userPlaylist } from "@/api/user";
import { getMusicU, setMusicU } from '@/utils/auth';
export default {
name: "Login",
@ -177,6 +178,10 @@ export default {
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();