From 449d27d5a1edc1d2e5b3107ab65fb8a3672fa412 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=87=AA=E5=B8=A6=E5=A4=A7=E4=BD=AC=E6=B0=94=E5=9C=BA?= <188633308@qq.com> Date: Wed, 28 Apr 2021 09:43:44 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E9=A6=96=E9=A1=B5=E4=B8=AA=E4=BA=BA?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=95=B0=E6=8D=AE=E7=BB=91=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Web/src/main.js | 16 +++++++++++++++- Web/src/pages/home/index.vue | 11 ++++------- 2 files changed, 19 insertions(+), 8 deletions(-) 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 }}