feat: use simpler nitro instead of nestjs to implement mock service

This commit is contained in:
vben
2024-07-20 08:31:05 +08:00
parent 9ec91ac16d
commit 9987451647
122 changed files with 2556 additions and 2967 deletions

View File

@@ -0,0 +1,17 @@
import type { UserApi } from '../types';
import { requestClient } from '#/forward';
/**
* 登录
*/
export async function login(data: UserApi.LoginParams) {
return requestClient.post<UserApi.LoginResult>('/auth/login', data);
}
/**
* 获取用户权限码
*/
export async function getAccessCodes() {
return requestClient.get<string[]>('/auth/codes');
}

View File

@@ -0,0 +1,3 @@
export * from './auth';
export * from './menu';
export * from './user';

View File

@@ -0,0 +1,10 @@
import type { RouteRecordStringComponent } from '@vben/types';
import { requestClient } from '#/forward';
/**
* 获取用户所有菜单
*/
export async function getAllMenus() {
return requestClient.get<RouteRecordStringComponent[]>('/menu/all');
}

View File

@@ -0,0 +1,10 @@
import type { UserInfo } from '@vben/types';
import { requestClient } from '#/forward';
/**
* 获取用户信息
*/
export async function getUserInfo() {
return requestClient.get<UserInfo>('/user/info');
}