Aq/aq-flex-web/mock/auth/index.ts

72 lines
1.5 KiB
TypeScript

import { defineFakeRoute } from 'vite-plugin-fake-server/client'
/**
* 用户认证
*/
export default defineFakeRoute([
{
url: '/auth/app',
method: 'get',
/**
* 当前用户应用列表
* @returns 返回值
*/
response: () => {
return {
data: [
{ id: 1, name: '测试应用 A', state: 0 },
{ id: 2, name: '测试应用 B', icon: 'planet', sort: 0, state: 0 },
],
code: 0,
duration: 15,
}
},
},
{
url: '/auth/menu',
method: 'get',
/**
* 菜单
* @returns 返回值
*/
response: () => {
return {
data: [
{
id: 1,
createdAt: '2023-03-23 09:49:25',
parentId: 0,
name: '系统管理',
code: '',
icon: '',
path: '/system',
component: 'basic/side',
type: 0,
description: '',
sort: 1,
appId: 1,
state: 0,
},
{
id: 2,
createdAt: '2023-03-23 09:28:44',
parentId: 1,
name: '用户管理',
code: '',
icon: '',
path: '/system/user',
component: 'system/user/index',
type: 1,
description: '',
sort: 2,
appId: 1,
state: 0,
},
],
code: 0,
duration: 19,
}
},
},
])