@zfqh/uniapp 0.2.15 → 0.2.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/lib/apis/request.d.ts +1 -1
- package/lib/apis/request.js +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/utils/request.d.ts +5 -5
- package/lib/utils/request.js +14 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.2.17](http://10.10.10.16/caoben/front-end/compare/@zfqh/uniapp@0.2.16...@zfqh/uniapp@0.2.17) (2026-06-25)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @zfqh/uniapp
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [0.2.16](http://10.10.10.16/caoben/front-end/compare/@zfqh/uniapp@0.2.15...@zfqh/uniapp@0.2.16) (2026-06-25)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @zfqh/uniapp
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
## [0.2.15](http://10.10.10.16/caoben/front-end/compare/@zfqh/uniapp@0.2.14...@zfqh/uniapp@0.2.15) (2026-06-25)
|
|
7
23
|
|
|
8
24
|
**Note:** Version bump only for package @zfqh/uniapp
|
package/lib/apis/request.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import http from '@gmcb/uv-ui/libs/function/http';
|
|
2
|
-
declare const GET: (url:
|
|
2
|
+
declare const GET: (url: string, data?: {}, options?: {}) => any, POST: (url: string, data?: {}, options?: {}) => any, PUT: (url: string, data?: {}, options?: {}) => any, DELETE: (url: string, data?: {}, options?: {}) => any;
|
|
3
3
|
export { GET, POST, PUT, DELETE };
|
|
4
4
|
export default http;
|
package/lib/apis/request.js
CHANGED
|
@@ -21,6 +21,6 @@ http.interceptors.request.use((conf) => {
|
|
|
21
21
|
return conf;
|
|
22
22
|
});
|
|
23
23
|
createInterceptors(http);
|
|
24
|
-
const { GET, POST, PUT, DELETE } = createRequest(http, { baseURL: api.baseUrl });
|
|
24
|
+
const { GET, POST, PUT, DELETE } = createRequest(http, () => ({ baseURL: api.baseUrl }));
|
|
25
25
|
export { GET, POST, PUT, DELETE };
|
|
26
26
|
export default http;
|
package/lib/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export * from './utils/request';
|
|
|
15
15
|
export * from './utils/subscribe';
|
|
16
16
|
export * from './utils/permit';
|
|
17
17
|
export * from './utils/audio';
|
|
18
|
+
export * from './utils/update';
|
|
18
19
|
export { default as query } from './utils/query';
|
|
19
20
|
export { default as Debounce, debounce } from './utils/debounce';
|
|
20
21
|
export { default as Throttle, throttle } from './utils/throttle';
|
package/lib/index.js
CHANGED
|
@@ -16,6 +16,7 @@ export * from './utils/request';
|
|
|
16
16
|
export * from './utils/subscribe';
|
|
17
17
|
export * from './utils/permit';
|
|
18
18
|
export * from './utils/audio';
|
|
19
|
+
export * from './utils/update';
|
|
19
20
|
export { default as query } from './utils/query';
|
|
20
21
|
export { default as Debounce, debounce } from './utils/debounce';
|
|
21
22
|
export { default as Throttle, throttle } from './utils/throttle';
|
package/lib/utils/request.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export declare function formatURL(url: any, data: any): string;
|
|
2
2
|
export declare function createInterceptors(req: any): void;
|
|
3
|
-
export declare function createRequest(req: any,
|
|
4
|
-
GET: (url:
|
|
5
|
-
DELETE: (url:
|
|
6
|
-
POST: (url:
|
|
7
|
-
PUT: (url:
|
|
3
|
+
export declare function createRequest(req: any, _opts?: any): {
|
|
4
|
+
GET: (url: string, data?: {}, options?: {}) => any;
|
|
5
|
+
DELETE: (url: string, data?: {}, options?: {}) => any;
|
|
6
|
+
POST: (url: string, data?: {}, options?: {}) => any;
|
|
7
|
+
PUT: (url: string, data?: {}, options?: {}) => any;
|
|
8
8
|
};
|
package/lib/utils/request.js
CHANGED
|
@@ -100,20 +100,33 @@ export function createInterceptors(req) {
|
|
|
100
100
|
return responseReject(error.response);
|
|
101
101
|
});
|
|
102
102
|
}
|
|
103
|
-
export function createRequest(req,
|
|
103
|
+
export function createRequest(req, _opts = {}) {
|
|
104
|
+
let opts = _opts;
|
|
104
105
|
const GET = (url, data = {}, options = {}) => {
|
|
106
|
+
if (typeof opts === 'function') {
|
|
107
|
+
opts = _opts();
|
|
108
|
+
}
|
|
105
109
|
url = formatURL(url, data);
|
|
106
110
|
return req.get(url, { params: data, ...opts, ...options });
|
|
107
111
|
};
|
|
108
112
|
const DELETE = (url, data = {}, options = {}) => {
|
|
113
|
+
if (typeof opts === 'function') {
|
|
114
|
+
opts = _opts();
|
|
115
|
+
}
|
|
109
116
|
url = formatURL(url, data);
|
|
110
117
|
return req.delete(url, data, { ...opts, ...options });
|
|
111
118
|
};
|
|
112
119
|
const POST = (url, data = {}, options = {}) => {
|
|
120
|
+
if (typeof opts === 'function') {
|
|
121
|
+
opts = _opts();
|
|
122
|
+
}
|
|
113
123
|
url = formatURL(url, data);
|
|
114
124
|
return req.post(url, data, { ...opts, ...options });
|
|
115
125
|
};
|
|
116
126
|
const PUT = (url, data = {}, options = {}) => {
|
|
127
|
+
if (typeof opts === 'function') {
|
|
128
|
+
opts = _opts();
|
|
129
|
+
}
|
|
117
130
|
url = formatURL(url, data);
|
|
118
131
|
return req.put(url, data, { ...opts, ...options });
|
|
119
132
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zfqh/uniapp",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.17",
|
|
4
4
|
"description": "uniapp公共模块",
|
|
5
5
|
"author": "yinjiazeng@163.com",
|
|
6
6
|
"license": "MIT",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"@types/qs": "^6.9.16",
|
|
47
47
|
"@types/url-parse": "^1.4.11"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "5095e47333d20f9b0ff6e79412eeb3f455f0e94e"
|
|
50
50
|
}
|