login.ts 463 B

12345678910111213141516171819
  1. import { http } from '@/utils/http'
  2. const pre = import.meta.env.VITE_API_SECONDARY_URL_PREFIX
  3. /**
  4. * 获取验证码
  5. * @param phone 手机号
  6. * @returns ICaptcha 验证码
  7. */
  8. export function getCode(phoneNo?: string) {
  9. return http.get<any>(`${pre}/api/user/getCode`, { phoneNo })
  10. }
  11. /**
  12. * 用户注册
  13. * @param registerForm 注册表单
  14. */
  15. export function register(registerForm: any) {
  16. return http.post<any>(`${pre}/api/user/register`, registerForm)
  17. }