ol-base-components 2.1.3 → 2.1.5
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/api/runApi.js +3 -4
- package/src/globalData.js +6 -16
- package/src/package/index.js +2 -4
package/package.json
CHANGED
package/src/api/runApi.js
CHANGED
|
@@ -3,12 +3,11 @@ const fs = require("fs");
|
|
|
3
3
|
const path = require("path");
|
|
4
4
|
const SwaggerClient = require("swagger-client");
|
|
5
5
|
const Vue = require("vue"); // 引入 Vue
|
|
6
|
-
|
|
6
|
+
const globalData = require("../globalData");
|
|
7
7
|
|
|
8
8
|
// const swaggerUrl = "http://220.179.249.140:20019/swagger/v1/swagger.json";
|
|
9
|
-
const swaggerUrl =
|
|
10
|
-
const modulesDir =
|
|
11
|
-
getGlobalData("outputDir") || path.join(__dirname, "./modules");
|
|
9
|
+
const swaggerUrl = globalData.swaggerUrl || "";
|
|
10
|
+
const modulesDir = globalData.outputDir || path.join(__dirname, "./modules");
|
|
12
11
|
|
|
13
12
|
SwaggerClient(swaggerUrl)
|
|
14
13
|
.then((client) => {
|
package/src/globalData.js
CHANGED
|
@@ -1,17 +1,7 @@
|
|
|
1
|
-
//
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
// data.js
|
|
2
|
+
let globalData = {
|
|
3
|
+
swaggerUrl: "",
|
|
4
|
+
outputDir: "",
|
|
5
|
+
};
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
this.data[key] = value;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
get(key) {
|
|
12
|
-
return this.data[key];
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const instance = new GlobalData();
|
|
17
|
-
export default instance;
|
|
7
|
+
module.exports = globalData;
|
package/src/package/index.js
CHANGED
|
@@ -192,10 +192,8 @@ const install = async function (
|
|
|
192
192
|
outputDir: "",
|
|
193
193
|
}
|
|
194
194
|
) {
|
|
195
|
-
if (options && options.swaggerUrl)
|
|
196
|
-
|
|
197
|
-
if (options && options.outputDir)
|
|
198
|
-
globalData.set("outputDir", options.outputDir);
|
|
195
|
+
if (options && options.swaggerUrl) globalData.swaggerUrl = options.swaggerUrl;
|
|
196
|
+
if (options && options.outputDir) globalData.outputDir = options.outputDir;
|
|
199
197
|
|
|
200
198
|
// 设置全局数据
|
|
201
199
|
components.map((item) => {
|