|
|
|
@ -1,4 +1,6 @@
|
|
|
|
|
import { isAccountLoggedIn } from "./auth";
|
|
|
|
|
import { refreshCookie } from "@/api/auth";
|
|
|
|
|
import dayjs from "dayjs";
|
|
|
|
|
import store from "@/store";
|
|
|
|
|
|
|
|
|
|
export function isTrackPlayable(track) {
|
|
|
|
@ -75,3 +77,17 @@ export function updateHttps(url) {
|
|
|
|
|
if (!url) return "";
|
|
|
|
|
return url.replace(/^http:/, "https:");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function dailyTask() {
|
|
|
|
|
if (
|
|
|
|
|
store.state.settings.lastRefreshCookieDate === undefined ||
|
|
|
|
|
store.state.settings.lastRefreshCookieDate !== dayjs().date()
|
|
|
|
|
) {
|
|
|
|
|
console.log("execute dailyTask");
|
|
|
|
|
store.commit("updateSettings", {
|
|
|
|
|
key: "lastRefreshCookieDate",
|
|
|
|
|
value: dayjs().date(),
|
|
|
|
|
});
|
|
|
|
|
refreshCookie();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|