diff --git a/Web/src/main.js b/Web/src/main.js index 7f33e88..731d3a5 100644 --- a/Web/src/main.js +++ b/Web/src/main.js @@ -45,7 +45,21 @@ Vue.prototype.$_ = _ */ import moment from 'moment' import 'moment/locale/zh-cn' -moment.locale('zh-cn') +moment.updateLocale('zh-cn', { + meridiem: function (hour, minute, isLowercase) { + if (hour < 9) { + return '早上' + } else if (hour < 11) { + return '上午' + } else if (hour < 13) { + return '中午' + } else if (hour < 18) { + return '下午' + } else { + return '晚上' + } + } +}) Vue.prototype.$moment = moment /** * 权限验证全局化 diff --git a/Web/src/pages/home/index.vue b/Web/src/pages/home/index.vue index 493baf3..b5ccad3 100644 --- a/Web/src/pages/home/index.vue +++ b/Web/src/pages/home/index.vue @@ -6,17 +6,14 @@
- +

- 上午好, - 软件开发人员,欢迎您登录系统! + {{ $moment().format('A') }}好, + {{ $root.global.info.nickName || $root.global.info.name }},欢迎您登录系统!

-

上次IP:115.217.160.156 上次登录时间:2021-04-06 13:10:13

+

上次IP:{{ $root.global.info.lastLoginIp }} 上次登录时间:{{ $root.global.info.lastLoginTime }}