feat: using vuex to make login status reactively (#51)

This commit is contained in:
Hawtim Zhang 2020-10-24 18:55:10 +08:00 committed by GitHub
parent 5ce9c3689a
commit 780b429fa9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 110 additions and 71 deletions

View file

@ -1,4 +1,4 @@
import { isLoggedIn } from "./auth";
import { isAccountLoggedIn } from "./auth";
import store from "@/store";
export function isTrackPlayable(track) {
@ -7,7 +7,7 @@ export function isTrackPlayable(track) {
reason: "",
};
if (track.fee === 1 || track.privilege?.fee === 1) {
if (isLoggedIn && store.state.settings.user.vipType === 11) {
if (isAccountLoggedIn() && store.state.settings.user.vipType === 11) {
result.playable = true;
} else {
result.playable = false;