Commit 1f2739df authored by 王波's avatar 王波

优化签到

parent c42183c6
...@@ -31,9 +31,7 @@ export default class SignService extends UserService { ...@@ -31,9 +31,7 @@ export default class SignService extends UserService {
userNick, userNick,
isSignLater: !!subscribeSignDay, isSignLater: !!subscribeSignDay,
createDay: today, createDay: today,
signTime: subscribeSignDay signTime: subscribeSignDay ? formatDate(subscribeSignDay).getDate() : formatDate().getDate(),
? formatDate(subscribeSignDay).format('YYYY-MM-DD')
: formatDate().format('YYYY-MM-DD'),
signDay: subscribeSignDay || today, signDay: subscribeSignDay || today,
createTime: Date.now() createTime: Date.now()
}) })
......
...@@ -6,7 +6,7 @@ interface IUserSign { ...@@ -6,7 +6,7 @@ interface IUserSign {
userNick: string userNick: string
createTime: number createTime: number
createDay: string createDay: string
signTime: string signTime?: any
signDay: string signDay: string
isSignLater?: boolean // 是否补签 isSignLater?: boolean // 是否补签
} }
......
...@@ -42,6 +42,7 @@ export function formatDate(date: string | number = Date.now()) { ...@@ -42,6 +42,7 @@ export function formatDate(date: string | number = Date.now()) {
getHour: () => dayjs(beijingDate).get('hour'), getHour: () => dayjs(beijingDate).get('hour'),
getMinute: () => dayjs(beijingDate).get('minute'), getMinute: () => dayjs(beijingDate).get('minute'),
geSecond: () => dayjs(beijingDate).get('second'), geSecond: () => dayjs(beijingDate).get('second'),
getMillisecond: () => dayjs(beijingDate).get('millisecond') getMillisecond: () => dayjs(beijingDate).get('millisecond'),
getDate: () => dayjs(beijingDate).date()
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment