ol-base-components 2.2.2 → 2.2.3

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/api/api.js +3 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ol-base-components",
3
- "version": "2.2.2",
3
+ "version": "2.2.3",
4
4
  "private": false,
5
5
  "main": "src/package/index.js",
6
6
  "bin": {
package/src/api/api.js CHANGED
@@ -103,9 +103,7 @@ const generateApiModules = (swagger) => {
103
103
  const apiModules = {};
104
104
  // 初始化模块对象
105
105
  tags.forEach((tag) => {
106
- apiModules[
107
- tag.name
108
- ] = `import { api } from "@/api/request/sendRuest"\n`;
106
+ apiModules[tag.name] = `import { api } from "@/api/request/sendRuest"\n`;
109
107
  });
110
108
 
111
109
  for (const [url, methods] of Object.entries(paths)) {
@@ -186,13 +184,14 @@ const generateApiModules = (swagger) => {
186
184
  functionDoc += `export const ${generateKeyName(
187
185
  url,
188
186
  method
189
- )} = (${functionParams}) => {\n`;
187
+ )} = (${functionParams}, options) => {\n`;
190
188
 
191
189
  functionDoc += ` return api({\n`;
192
190
  functionDoc += ` url: \`${url.replace(/{/g, "${")}\`,\n`;
193
191
  functionDoc += ` method: "${MethodEnum[method]}",\n`;
194
192
  if (hasQuery) functionDoc += ` params,\n`;
195
193
  if (hasBody) functionDoc += ` data: body,\n`;
194
+ functionDoc += ` ...options\n`;
196
195
  functionDoc += ` });\n`;
197
196
  functionDoc += `};\n\n`;
198
197
  apiModules[tag] += functionDoc;