From 14f7d39b1885442de42bdd81806774151baddd4f Mon Sep 17 00:00:00 2001 From: zhangwei <1504152376@qq.com> Date: 星期二, 22 七月 2025 15:37:03 +0800 Subject: [PATCH] 'ts报红部分解决' --- src/api/register/index.ts | 25 +++++++++++++------------ 1 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/api/register/index.ts b/src/api/register/index.ts index 0c7e2a2..8e407e1 100644 --- a/src/api/register/index.ts +++ b/src/api/register/index.ts @@ -8,13 +8,10 @@ import { http } from "@/utils/http"; import { baseUrlApi } from "../util"; -type Result = { - success: boolean; - data: Array<any>; -}; +import type { Result, CaptchaResult } from "../types"; export const register = (data?: object) => { - return http.request( + return http.request<Result>( "post", baseUrlApi("/api/customer/customerRegistration"), { data } @@ -22,7 +19,7 @@ }; export const captcha = () => { - return http.request<Result>("get", baseUrlApi("/api/zCSMS/captcha")); + return http.request<CaptchaResult>("get", baseUrlApi("/api/zCSMS/captcha")); }; //鑾峰彇瑙掕壊 @@ -31,8 +28,8 @@ }; // 鑾峰彇鎵嬫満楠岃瘉鐮� -export const phoneNumberCode = (params?: object) => { - return http.request( +export const phoneNumberCode = params => { + return http.request<Result>( "post", baseUrlApi( `/api/zCSMS/sendSMS/${params.phone}/${params.code}/${params.codeId}` @@ -42,7 +39,7 @@ // 娉ㄥ唽瑙掕壊鐢ㄦ埛璧勬枡 export const createrExRolsInformation = (data?: object) => { - return http.request( + return http.request<Result>( "post", baseUrlApi("/api/customer/createrExRolsInformation"), { data } @@ -51,7 +48,11 @@ // 鑾峰彇浼佷笟绫诲瀷 export const enterpriseTypes = (data?: object) => { - return http.request("post", baseUrlApi("/api/customer/enterpriseTypes"), { - data - }); + return http.request<Result>( + "post", + baseUrlApi("/api/customer/enterpriseTypes"), + { + data + } + ); }; -- Gitblit v1.9.1