From ba5f777ed0cf0a710b8d7a741e4bd8e16f1538b6 Mon Sep 17 00:00:00 2001 From: wangqiao Date: Mon, 18 Aug 2025 14:32:32 +0800 Subject: [PATCH] Add TypeScript types to API requests --- api/login/index.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/api/login/index.ts b/api/login/index.ts index 0365d3c..de5032c 100644 --- a/api/login/index.ts +++ b/api/login/index.ts @@ -8,39 +8,39 @@ import type { LoginParams, LoginResponseData, AppAuthLoginRespVO } from './types * @returns */ export const login = (params: LoginParams) => { - return useDollarFetchRequest.post('/prod-api/app-api/member/auth/login', params) + return useDollarFetchRequest.post>('/prod-api/app-api/member/auth/login', params) } /** * 发送手机验证码 */ export const sendCode = (params: { mobile: string }) => { - return useDollarFetchRequest.post('/prod-api/app-api/member/auth/send-sms-code', params) + return useDollarFetchRequest.post>('/prod-api/app-api/member/auth/send-sms-code', params) } /** * 使用手机 + 验证码登录 */ export const loginByMobile = (params: { mobile: string; code: string; socialCode?: string; socialType?: string; socialState?: string }) => { - return useDollarFetchRequest.post('/prod-api/app-api/member/auth/sms-login', params) + return useDollarFetchRequest.post>('/prod-api/app-api/member/auth/sms-login', params) } /** * 发送邮箱验证码 */ export const sendEmailCode = (params: { email: string }) => { - return useDollarFetchRequest.post('/prod-api/app-api/member/auth/send-email-code', params) + return useDollarFetchRequest.post>('/prod-api/app-api/member/auth/send-email-code', params) } /** * 使用邮箱 + 验证码登录 */ export const loginByEmail = (params: { email: string; code: string }) => { - return useDollarFetchRequest.post('/prod-api/app-api/member/auth/verify-code', params) + return useDollarFetchRequest.post>('/prod-api/app-api/member/auth/verify-code', params) } /** * 重置密码 */ export const resetPassword = (params: { password: string; code: string }) => { - return useDollarFetchRequest.put('/prod-api/app-api/member/user/update-password', params) + return useDollarFetchRequest.put>('/prod-api/app-api/member/user/update-password', params) }