From bf69dab41df6c06962a63dbc034fd28bb262e6da Mon Sep 17 00:00:00 2001 From: feige996 <1020102647@qq.com> Date: Mon, 22 Sep 2025 15:38:35 +0800 Subject: [PATCH] =?UTF-8?q?chore(api):=20=E4=BF=AE=E6=AD=A3postFooAPI2?= =?UTF-8?q?=E5=92=8CpostFooAPI3=E7=9A=84=E8=AF=B7=E6=B1=82=E5=8F=82?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将query参数从{name}改为{a:1, b:2}以符合微信小程序同时需要query和body参数的场景 --- src/api/foo.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/foo.ts b/src/api/foo.ts index 29ea980..cfa39a5 100644 --- a/src/api/foo.ts +++ b/src/api/foo.ts @@ -35,9 +35,9 @@ export function postFooAPI(name: string) { } /** POST 请求;需要传递 query 参数的范例;微信小程序经常有同时需要query参数和body参数的场景 */ export function postFooAPI2(name: string) { - return http.post('/foo', { name }, { name }) + return http.post('/foo', { name }, { a: 1, b: 2 }) } /** POST 请求;支持 传递 header 的范例 */ export function postFooAPI3(name: string) { - return http.post('/foo', { name }, { name }, { 'Content-Type-100': '100' }) + return http.post('/foo', { name }, { a: 1, b: 2 }, { 'Content-Type-100': '100' }) }