This commit is contained in:
2024-02-02 22:31:01 +08:00
parent 06a5f041bf
commit 486ea5013a
77 changed files with 17507 additions and 122 deletions

18
src/api/user/index.ts Normal file
View File

@@ -0,0 +1,18 @@
/**
* 用户信息相关接口
*/
import type { LoginByCodeParams, LoginParams, LoginResult } from './types';
import { get, post } from '@/utils/request';
import type { UserState } from '@/store/modules/user/types';
enum URL {
login = '/user/login',
loginByCode = '/user/loginByCode',
logout = '/user/logout',
profile = '/user/profile',
}
export const getUserProfile = () => get<UserState>({ url: URL.profile });
export const login = (data: LoginParams) => post<LoginResult>({ url: URL.login, data });
export const loginByCode = (data: LoginByCodeParams) => post<any>({ url: URL.loginByCode, data });
export const logout = () => post<any>({ url: URL.logout });