@cpzxrobot/sdk 1.3.65 → 1.3.67

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,6 +19,13 @@ class UserGateway extends Object {
19
19
  this.context.platform.setSelectedUnit(unit);
20
20
  }
21
21
  }
22
+ async factories() {
23
+ var selectedFarm = await this.context.user.getSelectedFarm();
24
+ var axios = await this.context.ready;
25
+ return axios.post('/api/v1/user/factories', {
26
+ selected_factory: selectedFarm
27
+ });
28
+ }
22
29
  //获得当前用户选择的单元
23
30
  getSelectedUnit() {
24
31
  return this.context.platform.getSelectedUnitFromMiniApp();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.3.65",
3
+ "version": "1.3.67",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
package/user_gateway.ts CHANGED
@@ -22,6 +22,14 @@ export class UserGateway extends Object {
22
22
  }
23
23
  }
24
24
 
25
+ public async factories() {
26
+ var selectedFarm = await this.context.user.getSelectedFarm()
27
+ var axios = await this.context.ready;
28
+ return axios.post('/api/v1/user/factories', {
29
+ selected_factory: selectedFarm
30
+ })
31
+ }
32
+
25
33
  //获得当前用户选择的单元
26
34
  getSelectedUnit() {
27
35
  return this.context.platform.getSelectedUnitFromMiniApp()
@@ -322,7 +330,7 @@ export class UserGateway extends Object {
322
330
  }
323
331
  }
324
332
 
325
- async info(userId: number|undefined) {
333
+ async info(userId: number | undefined) {
326
334
  var axios = await this.context.ready
327
335
  var factory = await this.context.user.getSelectedFarm()
328
336
  var url = '/api/v1/user/info'