index.ts 489 B

1234567891011121314151617181920212223
  1. import type { UserInfo } from '@vben/types';
  2. import { request } from '@/services/request';
  3. import type { UserApi } from './typing';
  4. /**
  5. * 登录
  6. */
  7. async function userLogin(data: UserApi.LoginParams) {
  8. return request<UserApi.LoginResult>('/login', { data, method: 'post' });
  9. }
  10. /**
  11. * 获取用户信息
  12. */
  13. async function getUserInfo() {
  14. return request<UserInfo>('/getUserInfo', { method: 'get' });
  15. }
  16. export { getUserInfo, userLogin };
  17. export type { UserApi } from './typing';