@cpzxrobot/sdk 1.3.66 → 1.3.68

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.
@@ -19,11 +19,12 @@ class UserGateway extends Object {
19
19
  this.context.platform.setSelectedUnit(unit);
20
20
  }
21
21
  }
22
- async factories() {
22
+ async factories(userId = 0) {
23
23
  var selectedFarm = await this.context.user.getSelectedFarm();
24
24
  var axios = await this.context.ready;
25
- return axios.post('/api/v2/user/factories', {
26
- selected_factory: selectedFarm
25
+ return axios.post('/api/v1/user/factories', {
26
+ selected_factory: selectedFarm,
27
+ user_id: userId,
27
28
  });
28
29
  }
29
30
  //获得当前用户选择的单元
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.3.66",
3
+ "version": "1.3.68",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
package/user_gateway.ts CHANGED
@@ -22,11 +22,13 @@ export class UserGateway extends Object {
22
22
  }
23
23
  }
24
24
 
25
- public async factories() {
25
+ public async factories(userId: number = 0) {
26
26
  var selectedFarm = await this.context.user.getSelectedFarm()
27
27
  var axios = await this.context.ready;
28
- return axios.post('/api/v2/user/factories', {
29
- selected_factory: selectedFarm
28
+
29
+ return axios.post('/api/v1/user/factories', {
30
+ selected_factory: selectedFarm,
31
+ user_id: userId,
30
32
  })
31
33
  }
32
34