feat: add backend-mock app

This commit is contained in:
vben
2024-06-30 14:09:44 +08:00
parent c58aa26dbf
commit ca1cad0cd3
71 changed files with 3420 additions and 735 deletions

View File

@@ -2,20 +2,20 @@ import type { UserInfo } from '@vben/types';
import type { UserApiType } from '../types';
import { get, post } from '#/forward';
import { requestClient } from '#/forward';
/**
* 登录
*/
async function userLogin(data: UserApiType.LoginParams) {
return post<UserApiType.LoginResult>('/login', data);
return requestClient.post<UserApiType.LoginResult>('/auth/login', data);
}
/**
* 获取用户信息
*/
async function getUserInfo() {
return get<UserInfo>('/getUserInfo');
return requestClient.get<UserInfo>('/auth/getUserInfo');
}
export { getUserInfo, userLogin };

View File

@@ -10,6 +10,7 @@ namespace UserApiType {
accessToken: string;
desc: string;
realName: string;
refreshToken: string;
userId: string;
username: string;
}