blob: b75761880556791425b93dff83b37ae64f40febf [file] [log] [blame]
Jiarenxiang38dcb052025-03-13 16:40:09 +08001import { request } from '@umijs/max';
2
3export async function getCaptchaImg(params?: Record<string, any>, options?: Record<string, any>) {
4 return request('/api/captchaImage', {
5 method: 'GET',
6 params: {
7 ...params,
8 },
9 headers: {
10 isToken: false,
11 },
12 ...(options || {}),
13 });
14}
15
16/** 登录接口 POST /api/login/account */
17export async function login(body: API.LoginParams, options?: Record<string, any>) {
18 return request<API.LoginResult>('/api/login', {
19 method: 'POST',
20 headers: {
21 isToken: false,
22 'Content-Type': 'application/json',
23 },
24 data: body,
25 ...(options || {}),
26 });
27}
28
29/** 退出登录接口 POST /api/login/outLogin */
30export async function logout() {
31 return request<Record<string, any>>('/api/logout', {
32 method: 'delete',
33 });
34}
35
36// 获取手机验证码
37export async function getMobileCaptcha(mobile: string) {
38 return request(`/api/login/captcha?mobile=${mobile}`);
39}