update:优化时间显示 (#1139)

This commit is contained in:
hrz
2025-05-07 23:21:47 +08:00
committed by GitHub
parent 92227098b7
commit e6d63a811e
3 changed files with 5 additions and 3 deletions
@@ -53,7 +53,9 @@ export default {
const now = new Date();
const diffMinutes = Math.floor((now - lastTime) / (1000 * 60));
if (diffMinutes < 60) {
if (diffMinutes <= 1) {
return '刚刚';
} else if (diffMinutes < 60) {
return `${diffMinutes}分钟前`;
} else if (diffMinutes < 24 * 60) {
const hours = Math.floor(diffMinutes / 60);