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

优化签到

parent c42183c6
......@@ -31,9 +31,7 @@ export default class SignService extends UserService {
userNick,
isSignLater: !!subscribeSignDay,
createDay: today,
signTime: subscribeSignDay
? formatDate(subscribeSignDay).format('YYYY-MM-DD')
: formatDate().format('YYYY-MM-DD'),
signTime: subscribeSignDay ? formatDate(subscribeSignDay).getDate() : formatDate().getDate(),
signDay: subscribeSignDay || today,
createTime: Date.now()
})
......
......@@ -6,7 +6,7 @@ interface IUserSign {
userNick: string
createTime: number
createDay: string
signTime: string
signTime?: any
signDay: string
isSignLater?: boolean // 是否补签
}
......
......@@ -42,6 +42,7 @@ export function formatDate(date: string | number = Date.now()) {
getHour: () => dayjs(beijingDate).get('hour'),
getMinute: () => dayjs(beijingDate).get('minute'),
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