mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-08-29 04:29:16 +08:00
v2.0
This commit is contained in:
53
web/mock/user/menus.ts
Normal file
53
web/mock/user/menus.ts
Normal file
@@ -0,0 +1,53 @@
|
||||
import {resultSuccess} from '../_util';
|
||||
import {ApiEnum} from "@/enums/apiEnum";
|
||||
|
||||
const menusList = [
|
||||
{
|
||||
path: '/dashboard',
|
||||
name: 'Dashboard',
|
||||
component: 'LAYOUT',
|
||||
redirect: '/dashboard/console',
|
||||
meta: {
|
||||
icon: 'DashboardOutlined',
|
||||
title: 'Dashboard',
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'console',
|
||||
name: 'dashboard_console',
|
||||
component: '/dashboard/console/console',
|
||||
meta: {
|
||||
title: '主控台',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'monitor',
|
||||
name: 'dashboard_monitor',
|
||||
component: '/dashboard/monitor/monitor',
|
||||
meta: {
|
||||
title: '监控页',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'workplace',
|
||||
name: 'dashboard_workplace',
|
||||
component: '/dashboard/workplace/workplace',
|
||||
meta: {
|
||||
hidden: true,
|
||||
title: '工作台',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
export default [
|
||||
{
|
||||
url: ApiEnum.RoleDynamic,
|
||||
timeout: 1000,
|
||||
method: 'get',
|
||||
response: () => {
|
||||
return resultSuccess(menusList);
|
||||
},
|
||||
},
|
||||
];
|
60
web/mock/user/user.ts
Normal file
60
web/mock/user/user.ts
Normal file
@@ -0,0 +1,60 @@
|
||||
import Mock from 'mockjs';
|
||||
import {ApiEnum} from '@/enums/apiEnum';
|
||||
import {resultSuccess} from '../_util';
|
||||
|
||||
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 [
|
||||
{
|
||||
url: ApiEnum.SiteLogin,
|
||||
timeout: 1000,
|
||||
method: 'post',
|
||||
response: () => {
|
||||
return resultSuccess({token});
|
||||
},
|
||||
},
|
||||
{
|
||||
url: ApiEnum.MemberInfo, //ApiEnum.Prefix +
|
||||
timeout: 1000,
|
||||
method: 'get',
|
||||
response: () => {
|
||||
// const token = getRequestToken(request);
|
||||
// if (!token) return resultError('Invalid token');
|
||||
return resultSuccess(adminInfo);
|
||||
},
|
||||
},
|
||||
];
|
Reference in New Issue
Block a user