feima-shortcuts 1.0.6 → 1.0.8
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/package.json +1 -1
- package/src/generateApi/index.js +6 -3
package/package.json
CHANGED
package/src/generateApi/index.js
CHANGED
|
@@ -141,8 +141,10 @@ export const request = <T>(
|
|
|
141
141
|
config: OpenAPIConfig,
|
|
142
142
|
options: ApiRequestOptions
|
|
143
143
|
): CancelablePromise<T> => {
|
|
144
|
+
const { query, ...rest } = options;
|
|
145
|
+
|
|
144
146
|
return new CancelablePromise((resolve, reject, onCancel) => {
|
|
145
|
-
const url = \`\${config.BASE}\${
|
|
147
|
+
const url = \`\${config.BASE}\${rest.url}\`;
|
|
146
148
|
|
|
147
149
|
const source = axios.CancelToken.source();
|
|
148
150
|
|
|
@@ -150,9 +152,10 @@ export const request = <T>(
|
|
|
150
152
|
|
|
151
153
|
service
|
|
152
154
|
.request({
|
|
153
|
-
...
|
|
155
|
+
...rest,
|
|
156
|
+
params: query,
|
|
154
157
|
url,
|
|
155
|
-
data:
|
|
158
|
+
data: rest?.body,
|
|
156
159
|
cancelToken: source.token,
|
|
157
160
|
})
|
|
158
161
|
.then((data: any) => {
|