2024-06-02 20:47:50 +08:00
|
|
|
import type { UserInfo } from '@vben/types';
|
|
|
|
|
|
2024-06-16 19:17:34 +08:00
|
|
|
import type { UserApiType } from '../types';
|
2024-06-08 19:49:06 +08:00
|
|
|
|
2024-06-16 23:40:52 +08:00
|
|
|
import { request } from '#/forward';
|
2024-06-02 20:47:50 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 登录
|
|
|
|
|
*/
|
|
|
|
|
async function userLogin(data: UserApiType.LoginParams) {
|
|
|
|
|
return request<UserApiType.LoginResult>('/login', { data, method: 'post' });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取用户信息
|
|
|
|
|
*/
|
|
|
|
|
async function getUserInfo() {
|
|
|
|
|
return request<UserInfo>('/getUserInfo', { method: 'get' });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export { getUserInfo, userLogin };
|
|
|
|
|
|
|
|
|
|
export * from './user';
|