hunter-open-sdk 1.0.0 → 1.0.2

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.
@@ -70,10 +70,10 @@ var deleteGlobalProperty = exports.deleteGlobalProperty = function deleteGlobalP
70
70
  * 安全地获取HunterInspectionKit对象
71
71
  * @returns {Object|null} HunterInspectionKit对象,如果不存在则返回null
72
72
  */
73
- var getHunterInspectionKit = exports.getHunterInspectionKit = function getHunterInspectionKit() {
73
+ var getHunterInspectionKit = exports.getHunterInspectionKit = function getHunterInspectionKit(willInit) {
74
74
  var kit = getGlobalProperty('HunterInspectionKit');
75
75
  if (!kit) {
76
- console.warn('HunterInspectionKit未初始化,请先调用HunterInspectionKit()函数');
76
+ !willInit && console.warn('HunterInspectionKit未初始化,请先调用HunterInspectionKit()函数');
77
77
  return null;
78
78
  }
79
79
  return kit;
@@ -86,10 +86,10 @@ var getHunterInspectionKit = exports.getHunterInspectionKit = function getHunter
86
86
  * @returns {any|null} 方法返回值,如果调用失败则返回null
87
87
  */
88
88
  var callHunterInspectionKit = exports.callHunterInspectionKit = function callHunterInspectionKit(methodName) {
89
- var kit = getHunterInspectionKit();
89
+ var kit = getHunterInspectionKit(true);
90
90
  if (!kit) {
91
91
  (0, _utils.HunterInspectionKit)();
92
- kit = getHunterInspectionKit();
92
+ kit = getHunterInspectionKit(false);
93
93
  }
94
94
  if (!kit || typeof kit[methodName] !== 'function') {
95
95
  console.error("HunterInspectionKit.".concat(methodName, "\u65B9\u6CD5\u4E0D\u5B58\u5728\u6216\u672A\u521D\u59CB\u5316"));
@@ -121,7 +121,8 @@ var getGeneralReportCallKit = exports.getGeneralReportCallKit = function getGene
121
121
  if (reportRes) {
122
122
  var reportResObj = JSON.parse(reportRes);
123
123
  var Code = reportResObj.Code,
124
- Data = reportResObj.Data;
124
+ Data = reportResObj.Data,
125
+ Message = reportResObj.Message;
125
126
  if (Code == 0 && Data) {
126
127
  return {
127
128
  type: 'getGeneralReportSuccess',
@@ -137,7 +138,7 @@ var getGeneralReportCallKit = exports.getGeneralReportCallKit = function getGene
137
138
  data: {
138
139
  code: -1,
139
140
  data: {},
140
- message: '获取报告结果为空'
141
+ message: Message || '获取报告结果为空'
141
142
  }
142
143
  };
143
144
  }
@@ -161,7 +162,8 @@ var getSaaSReportCallKit = exports.getSaaSReportCallKit = function getSaaSReport
161
162
  if (reportRes) {
162
163
  var reportResObj = JSON.parse(reportRes);
163
164
  var Code = reportResObj.Code,
164
- Data = reportResObj.Data;
165
+ Data = reportResObj.Data,
166
+ Message = reportResObj.Message;
165
167
  if (Code == 0 && Data) {
166
168
  return {
167
169
  type: 'getSaaSReportSuccess',
@@ -177,7 +179,7 @@ var getSaaSReportCallKit = exports.getSaaSReportCallKit = function getSaaSReport
177
179
  data: {
178
180
  code: -1,
179
181
  data: {},
180
- message: '获取SaaS报告结果为空'
182
+ message: Message || '获取SaaS报告结果为空'
181
183
  }
182
184
  };
183
185
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hunter-open-sdk",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "采货侠SaaS版本桌面端sdk",
5
5
  "scripts": {
6
6
  "start": "zz dev",