chore: optimize the code of workplace; 🌟

This commit is contained in:
chenghongxing
2020-07-20 18:11:13 +08:00
parent 82e5955c3b
commit d91f3a8661
6 changed files with 42 additions and 71 deletions

View File

@@ -1,19 +1,11 @@
import Mock from 'mockjs'
import '@/mock/extend'
const userDB = Mock.mock({
'list|2-10': [
{
name: '@ADMIN',
avatar: '@AVATAR',
address: '@CITY',
welcome: '@WELCOME',
timeFix: '@TIMEFIX',
position: '@position'
}
]
}).list
Mock.mock('/user/current', 'get', () => {
return userDB[0]
const welcome = Mock.mock({
timeFix: '@TIMEFIX',
message: '@WELCOME'
})
Mock.mock('/user/welcome', 'get', () => {
return welcome
})

View File

@@ -5,8 +5,6 @@ const user = Mock.mock({
name: '@ADMIN',
avatar: '@AVATAR',
address: '@CITY',
welcome: '@WELCOME',
timeFix: '@TIMEFIX',
position: '@POSITION'
})