@zfqh/uniapp 0.2.16 → 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 CHANGED
@@ -3,6 +3,14 @@
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
+
6
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)
7
15
 
8
16
  **Note:** Version bump only for package @zfqh/uniapp
@@ -1,4 +1,4 @@
1
1
  import http from '@gmcb/uv-ui/libs/function/http';
2
- declare const GET: (url: any, data?: {}, options?: {}) => any, POST: (url: any, data?: {}, options?: {}) => any, PUT: (url: any, data?: {}, options?: {}) => any, DELETE: (url: any, data?: {}, options?: {}) => any;
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;
@@ -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;
@@ -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, opts?: {}): {
4
- GET: (url: any, data?: {}, options?: {}) => any;
5
- DELETE: (url: any, data?: {}, options?: {}) => any;
6
- POST: (url: any, data?: {}, options?: {}) => any;
7
- PUT: (url: any, data?: {}, options?: {}) => any;
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
  };
@@ -100,20 +100,33 @@ export function createInterceptors(req) {
100
100
  return responseReject(error.response);
101
101
  });
102
102
  }
103
- export function createRequest(req, opts = {}) {
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.16",
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": "7ca4b88816e37917397abad3d2a67a9b34f93ab6"
49
+ "gitHead": "5095e47333d20f9b0ff6e79412eeb3f455f0e94e"
50
50
  }