chore(api): 修正postFooAPI2和postFooAPI3的请求参数

将query参数从{name}改为{a:1, b:2}以符合微信小程序同时需要query和body参数的场景
This commit is contained in:
feige996
2025-09-22 15:38:35 +08:00
parent f78d6eba0f
commit bf69dab41d

View File

@@ -35,9 +35,9 @@ export function postFooAPI(name: string) {
}
/** POST 请求;需要传递 query 参数的范例微信小程序经常有同时需要query参数和body参数的场景 */
export function postFooAPI2(name: string) {
return http.post<IFooItem>('/foo', { name }, { name })
return http.post<IFooItem>('/foo', { name }, { a: 1, b: 2 })
}
/** POST 请求;支持 传递 header 的范例 */
export function postFooAPI3(name: string) {
return http.post<IFooItem>('/foo', { name }, { name }, { 'Content-Type-100': '100' })
return http.post<IFooItem>('/foo', { name }, { a: 1, b: 2 }, { 'Content-Type-100': '100' })
}