mirror of
https://github.com/jekip/naive-ui-admin.git
synced 2026-03-01 00:23:11 +08:00
2.0.0
This commit is contained in:
44
mock/user/index.ts
Normal file
44
mock/user/index.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
import Mock from 'mockjs';
|
||||
import { resultSuccess } from '../_util';
|
||||
import { defineMock } from '@alova/mock';
|
||||
|
||||
const Random = Mock.Random;
|
||||
|
||||
const token = Random.string('upper', 32, 32);
|
||||
|
||||
const adminInfo = {
|
||||
userId: '1',
|
||||
username: 'admin',
|
||||
realName: 'Admin',
|
||||
avatar: Random.image(),
|
||||
desc: 'manager',
|
||||
password: Random.string('upper', 4, 16),
|
||||
token,
|
||||
permissions: [
|
||||
{
|
||||
label: '主控台',
|
||||
value: 'dashboard_console',
|
||||
},
|
||||
{
|
||||
label: '监控页',
|
||||
value: 'dashboard_monitor',
|
||||
},
|
||||
{
|
||||
label: '工作台',
|
||||
value: 'dashboard_workplace',
|
||||
},
|
||||
{
|
||||
label: '基础列表',
|
||||
value: 'basic_list',
|
||||
},
|
||||
{
|
||||
label: '基础列表删除',
|
||||
value: 'basic_list_delete',
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default defineMock({
|
||||
'[POST]/api/login': () => resultSuccess({ token }),
|
||||
'/api/admin_info': () => resultSuccess(adminInfo),
|
||||
});
|
||||
Reference in New Issue
Block a user