update 首页个人信息数据绑定

This commit is contained in:
2021-04-28 09:43:44 +08:00
parent a52dd1bdb2
commit 449d27d5a1
2 changed files with 19 additions and 8 deletions

View File

@@ -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
/**
* 权限验证全局化

View File

@@ -6,17 +6,14 @@
<a-col>
<div class="home-header-row">
<div class="home-header-avatar">
<a-avatar
:size="64"
src="https://gss0.baidu.com/7Ls0a8Sm2Q5IlBGlnYG/sys/portraith/item/tb.1.9f0e4392.Q2njD2SGV-9wBUKqKFoQqA?t=1507123743"
/>
<yo-image :id="$root.global.info.avatar" :size="64" type="avatar" />
</div>
<div class="home-header-content">
<h2>
上午
<span>软件开发人员</span>欢迎您登录系统
{{ $moment().format('A') }}
<span>{{ $root.global.info.nickName || $root.global.info.name }}</span>欢迎您登录系统
</h2>
<p>上次IP115.217.160.156 上次登录时间2021-04-06 13:10:13</p>
<p>上次IP{{ $root.global.info.lastLoginIp }} 上次登录时间{{ $root.global.info.lastLoginTime }}</p>
</div>
</div>
</a-col>