chore: optimize the i18n code of router; 🌟
This commit is contained in:
@@ -16,11 +16,15 @@ const timeList = [
|
||||
CN: '中午好',
|
||||
HK: '中午好',
|
||||
US: 'Good afternoon',
|
||||
},{
|
||||
CN: '下午好',
|
||||
HK: '下午好',
|
||||
US: 'Good afternoon',
|
||||
},{
|
||||
CN: '晚上好',
|
||||
HK: '晚上好',
|
||||
US: 'Good evening',
|
||||
},
|
||||
}
|
||||
]
|
||||
|
||||
const welcomeMessages = [
|
||||
@@ -56,7 +60,8 @@ Random.extend({
|
||||
timeFix () {
|
||||
const time = new Date()
|
||||
const hour = time.getHours()
|
||||
return hour < 9 ? timeList[0] : (hour <= 11 ? timeList[1] : (hour <= 13 ? timeList[2] : (hour <= 20 ? timeList[3] : timeList[4])))
|
||||
return hour < 9
|
||||
? timeList[0] : (hour <= 11 ? timeList[1] : (hour <= 13 ? timeList[2] : (hour <= 20 ? timeList[3] : timeList[4])))
|
||||
},
|
||||
avatar () {
|
||||
return this.pick(avatars)
|
||||
|
||||
Reference in New Issue
Block a user