From 18de3f3e22336a33e40f7f67f1019e04da78f2ff Mon Sep 17 00:00:00 2001 From: feige996 <1020102647@qq.com> Date: Wed, 12 Mar 2025 09:57:56 +0800 Subject: [PATCH 1/2] chore: update version to 2.6.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c22e631..25935dd 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "unibest", "type": "commonjs", - "version": "2.5.5", + "version": "2.6.2", "description": "unibest - 最好的 uniapp 开发模板", "author": { "name": "feige996", From b59e8993967659af24e038194d487adec2c94ba6 Mon Sep 17 00:00:00 2001 From: feige996 <1020102647@qq.com> Date: Sat, 12 Apr 2025 11:02:48 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0header=E7=9A=84?= =?UTF-8?q?=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/service/index/foo.ts | 4 ++-- src/utils/http.ts | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/service/index/foo.ts b/src/service/index/foo.ts index acf5aa8..340b8ba 100644 --- a/src/service/index/foo.ts +++ b/src/service/index/foo.ts @@ -6,10 +6,10 @@ export interface IFooItem { /** GET 请求 */ export const getFooAPI = (name: string) => { - return http.get('/foo', { name }) + return http.get('/foo', { name }, { 'Content-Type-100': '100' }) } /** POST 请求 */ export const postFooAPI = (name: string) => { - return http.post('/foo', { name }, { name }) + return http.post('/foo', { name }, { name }, { 'Content-Type-100': '100' }) } diff --git a/src/utils/http.ts b/src/utils/http.ts index 4e3f38c..13045c9 100644 --- a/src/utils/http.ts +++ b/src/utils/http.ts @@ -48,11 +48,16 @@ export const http = (options: CustomRequestOptions) => { * @param query 请求query参数 * @returns */ -export const httpGet = (url: string, query?: Record) => { +export const httpGet = ( + url: string, + query?: Record, + header?: Record, +) => { return http({ url, query, method: 'GET', + header, }) } @@ -67,12 +72,14 @@ export const httpPost = ( url: string, data?: Record, query?: Record, + header?: Record, ) => { return http({ url, query, data, method: 'POST', + header, }) }