Merge pull request '优化日期显示' (#31) from tongChong/forgeplus-react:pre_develop_dev into pre_develop_dev

This commit is contained in:
baladiwei 2021-08-27 16:33:43 +08:00
commit 8adf7f8de6
1 changed files with 2 additions and 1 deletions

View File

@ -107,7 +107,7 @@ export function timeAgo(backDate) {
try { try {
moment(backDate); moment(backDate);
} catch (e) { } catch (e) {
return; return '刚刚';
} }
if(typeof backDate ==='number'){ if(typeof backDate ==='number'){
backDate=backDate*1000 backDate=backDate*1000
@ -134,4 +134,5 @@ export function timeAgo(backDate) {
if (seconds) { if (seconds) {
return seconds + "秒前"; return seconds + "秒前";
} }
return "刚刚";
} }