BirdNETM | 11aacb9 | 2025-06-07 23:17:03 +0800 | [diff] [blame^] | 1 | import { request } from '@umijs/max'; |
| 2 | import type { |
| 3 | GetInviteCodeResponse, |
| 4 | GetUserByInviteCodeResponse |
| 5 | } from './data'; |
| 6 | |
| 7 | // 获取用户邀请码 |
| 8 | export async function getUserInviteCode(): Promise<GetInviteCodeResponse> { |
| 9 | return request('/api/system/user/invite/code', { |
| 10 | method: 'GET', // 修改为 GET 请求 |
| 11 | }); |
| 12 | } |
| 13 | |
| 14 | // 根据邀请码获取用户信息 |
| 15 | export async function getUserByInviteCode(code: string): Promise<GetUserByInviteCodeResponse> { |
| 16 | return request(`/api/system/user/invite/user/${code}`, { |
| 17 | method: 'GET', // 修改为 GET 请求,并使用路径参数 |
| 18 | }); |
| 19 | } |