@cpzxrobot/sdk 1.3.107 → 1.3.109

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.
@@ -149,17 +149,19 @@ class FactoryGateway extends Object {
149
149
  return __awaiter(this, void 0, void 0, function* () {
150
150
  var axios = yield this.context.ready;
151
151
  var baseUrl = `/api/v1/factory/${id}/workshops`;
152
+ var response = null;
152
153
  if (!tags) {
153
- const response = yield axios.get(baseUrl);
154
- return response.data;
154
+ response = yield axios.get(baseUrl);
155
+ }
156
+ else {
157
+ response = yield axios.get(`${baseUrl}?tags=${tags === null || tags === void 0 ? void 0 : tags.join(',')}`);
155
158
  }
156
- const response = yield axios.get(`${baseUrl}?tags=${tags === null || tags === void 0 ? void 0 : tags.join(',')}`);
157
159
  const body = response.data;
158
- if (body.code === 200) {
159
- return body.data;
160
+ if (body.Error) {
161
+ throw new Error(body.Error);
160
162
  }
161
163
  else {
162
- throw new Error(body.message);
164
+ return body;
163
165
  }
164
166
  });
165
167
  }
@@ -132,16 +132,17 @@ export class FactoryGateway extends Object {
132
132
  async workshops(id: number, tags?: string[]): Promise<any> {
133
133
  var axios = await this.context.ready;
134
134
  var baseUrl = `/api/v1/factory/${id}/workshops`;
135
+ var response = null;
135
136
  if (!tags) {
136
- const response = await axios.get(baseUrl);
137
- return response.data;
137
+ response = await axios.get(baseUrl);
138
+ }else{
139
+ response = await axios.get(`${baseUrl}?tags=${tags?.join(',')}`);
138
140
  }
139
- const response = await axios.get(`${baseUrl}?tags=${tags?.join(',')}`);
140
141
  const body = response.data;
141
- if (body.code === 200) {
142
- return body.data;
142
+ if (body.Error) {
143
+ throw new Error(body.Error);
143
144
  }else{
144
- throw new Error(body.message);
145
+ return body;
145
146
  }
146
147
  }
147
148
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.3.107",
3
+ "version": "1.3.109",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {