@cpzxrobot/sdk 1.2.81 → 1.2.82

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.
@@ -119,10 +119,21 @@ class UserGateway extends Object {
119
119
  });
120
120
  }
121
121
  async listByRole(role) {
122
+ var args = {};
123
+ if (typeof role === "string") {
124
+ args = {
125
+ roleCode: role
126
+ };
127
+ }
128
+ else {
129
+ args = Object.assign({}, role);
130
+ }
122
131
  var axios = await this.context.ready;
123
132
  var factory = await this.context.user.getSelectedFarm();
124
133
  //当前如果打开的是公司,则说明该应用支持在公司级别打开,则要求该应用应该有对应的公司级别的角色配置,所以并不需要查找公司下属工厂或工厂的对应公司,再去查找用户
125
- return axios.get(`/api/v2/company/${factory.id}/users?roleCode=${role}`);
134
+ return axios.get(`/api/v2/company/${factory.id}/users`, {
135
+ params: args
136
+ });
126
137
  }
127
138
  async mypermission(params = undefined) {
128
139
  var axios = await this.context.ready;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.2.81",
3
+ "version": "1.2.82",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
package/user_gateway.ts CHANGED
@@ -130,11 +130,26 @@ export class UserGateway extends Object {
130
130
  });
131
131
  }
132
132
 
133
- async listByRole(role: string) {
133
+ async listByRole(role: string | {
134
+ deptName: string;
135
+ roleCode: string;
136
+ }) {
137
+ var args = {};
138
+ if (typeof role === "string") {
139
+ args = {
140
+ roleCode: role
141
+ }
142
+ }else{
143
+ args = {
144
+ ...role,
145
+ }
146
+ }
134
147
  var axios = await this.context.ready;
135
148
  var factory = await this.context.user.getSelectedFarm();
136
149
  //当前如果打开的是公司,则说明该应用支持在公司级别打开,则要求该应用应该有对应的公司级别的角色配置,所以并不需要查找公司下属工厂或工厂的对应公司,再去查找用户
137
- return axios.get(`/api/v2/company/${factory.id}/users?roleCode=${role}`);
150
+ return axios.get(`/api/v2/company/${factory.id}/users`,{
151
+ params: args
152
+ });
138
153
  }
139
154
 
140
155
  async mypermission(params: any = undefined) {