mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-17 05:38:04 +00:00
feat: automatically get daily signin points
This commit is contained in:
parent
7d456f7460
commit
3449c02d0c
1 changed files with 6 additions and 2 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
import { isAccountLoggedIn } from "./auth";
|
import { isAccountLoggedIn } from "./auth";
|
||||||
import { refreshCookie } from "@/api/auth";
|
import { refreshCookie } from "@/api/auth";
|
||||||
|
import { dailySignin } from "@/api/user";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import store from "@/store";
|
import store from "@/store";
|
||||||
|
|
||||||
|
|
@ -79,9 +80,10 @@ export function updateHttps(url) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function dailyTask() {
|
export function dailyTask() {
|
||||||
|
let lastDate = store.state.settings.lastRefreshCookieDate;
|
||||||
if (
|
if (
|
||||||
store.state.settings.lastRefreshCookieDate === undefined ||
|
isAccountLoggedIn() &&
|
||||||
store.state.settings.lastRefreshCookieDate !== dayjs().date()
|
(lastDate === undefined || lastDate !== dayjs().date())
|
||||||
) {
|
) {
|
||||||
console.log("execute dailyTask");
|
console.log("execute dailyTask");
|
||||||
store.commit("updateSettings", {
|
store.commit("updateSettings", {
|
||||||
|
|
@ -89,5 +91,7 @@ export function dailyTask() {
|
||||||
value: dayjs().date(),
|
value: dayjs().date(),
|
||||||
});
|
});
|
||||||
refreshCookie();
|
refreshCookie();
|
||||||
|
dailySignin(0);
|
||||||
|
dailySignin(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue