From 3449c02d0c57caae72db00ede278adc2304b124f Mon Sep 17 00:00:00 2001
From: qier222 <68148142+qier222@users.noreply.github.com>
Date: Sun, 25 Oct 2020 14:09:13 +0800
Subject: [PATCH 1/2] feat: automatically get daily signin points
---
src/utils/common.js | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/utils/common.js b/src/utils/common.js
index cf693f0..4f76fd8 100644
--- a/src/utils/common.js
+++ b/src/utils/common.js
@@ -1,5 +1,6 @@
import { isAccountLoggedIn } from "./auth";
import { refreshCookie } from "@/api/auth";
+import { dailySignin } from "@/api/user";
import dayjs from "dayjs";
import store from "@/store";
@@ -79,9 +80,10 @@ export function updateHttps(url) {
}
export function dailyTask() {
+ let lastDate = store.state.settings.lastRefreshCookieDate;
if (
- store.state.settings.lastRefreshCookieDate === undefined ||
- store.state.settings.lastRefreshCookieDate !== dayjs().date()
+ isAccountLoggedIn() &&
+ (lastDate === undefined || lastDate !== dayjs().date())
) {
console.log("execute dailyTask");
store.commit("updateSettings", {
@@ -89,5 +91,7 @@ export function dailyTask() {
value: dayjs().date(),
});
refreshCookie();
+ dailySignin(0);
+ dailySignin(1);
}
}
From e9b6a81befa95984a74b4409e17afa2859b65000 Mon Sep 17 00:00:00 2001
From: qier222 <68148142+qier222@users.noreply.github.com>
Date: Sun, 25 Oct 2020 14:12:31 +0800
Subject: [PATCH 2/2] fix: some bugs
---
src/api/user.js | 25 +++++++++++--------------
src/components/Cover.vue | 1 +
src/components/Navbar.vue | 2 +-
src/main.js | 1 -
4 files changed, 13 insertions(+), 16 deletions(-)
diff --git a/src/api/user.js b/src/api/user.js
index edabc43..45156e0 100644
--- a/src/api/user.js
+++ b/src/api/user.js
@@ -1,19 +1,5 @@
import request from "@/utils/request";
-export function login(params) {
- // 必选参数 :
- // phone: 手机号码
- // password: 密码
- // 可选参数 :
- // countrycode: 国家码,用于国外手机号登陆,例如美国传入:1
- // md5_password: md5加密后的密码,传入后 password 将失效
- return request({
- url: "/login/cellphone",
- method: "get",
- params,
- });
-}
-
export function userDetail(uid) {
return request({
url: "/user/detail",
@@ -44,3 +30,14 @@ export function userLikedSongsIDs(uid) {
},
});
}
+
+export function dailySignin(type = 0) {
+ //可选参数 : type: 签到类型 , 默认 0, 其中 0 为安卓端签到 ,1 为 web/PC 签到
+ return request({
+ url: "/daily_signin",
+ method: "post",
+ params: {
+ type,
+ },
+ });
+}
diff --git a/src/components/Cover.vue b/src/components/Cover.vue
index c074211..f821543 100644
--- a/src/components/Cover.vue
+++ b/src/components/Cover.vue
@@ -163,6 +163,7 @@ export default {
filter: blur(16px) opacity(0.6);
z-index: -1;
height: 208px;
+ transform: scale(0.98);
}
.play-button {
opacity: 0;
diff --git a/src/components/Navbar.vue b/src/components/Navbar.vue
index 8f06dfc..fbdfeab 100644
--- a/src/components/Navbar.vue
+++ b/src/components/Navbar.vue
@@ -27,7 +27,7 @@