Skip to content

Commit

Permalink
fix(租户管理): 租户端资产、成员管理
Browse files Browse the repository at this point in the history
资产、成员绑定与解绑接口根据用户身份判断

fix #209
  • Loading branch information
Lind-pro committed Sep 21, 2020
1 parent 17857f7 commit 85f5b40
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/pages/system/tenant/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { map, filter, flatMap } from "rxjs/operators";
import { TenantItem } from "./data";

class Service extends BaseService<TenantItem>{
private tenant = localStorage.getItem('tenants-admin');
public create = (params: any) => defer(() => from(request(`/jetlinks/tenant/_create`, {
method: 'POST',
data: params
Expand Down Expand Up @@ -54,15 +55,15 @@ class Service extends BaseService<TenantItem>{
)),
bind: (id: string, data: { name: string, userId: string, admin: boolean }[]) => defer(
() => from(
request(`/jetlinks/tenant/${id}/members/_bind`, {
request(this.tenant === 'true' ? `/jetlinks/tenant/members/_bind` : `/jetlinks/tenant/${id}/members/_bind`, {
method: 'POST',
data,
})).pipe(
filter(resp => resp.status === 200),
map(resp => resp.result)
)),
unBind: (id: string, data: string[]) => defer(() => from(
request(`/jetlinks/tenant/${id}/members/_unbind`, {
request(this.tenant === 'true' ? `/jetlinks/tenant/members/_unbind` : `/jetlinks/tenant/${id}/members/_unbind`, {
method: 'POST',
data
})).pipe(
Expand Down Expand Up @@ -94,7 +95,7 @@ class Service extends BaseService<TenantItem>{
assetIdList: string[],
allPermission: boolean
}[]) => defer(() => from(
request(`/jetlinks/tenant/${id}/assets/_bind`, {
request(this.tenant === 'true' ? `/jetlinks/tenant/assets/_bind` : `/jetlinks/tenant/${id}/assets/_bind`, {
method: 'POST',
data
})).pipe(
Expand All @@ -106,7 +107,7 @@ class Service extends BaseService<TenantItem>{
assetType: string,
assetIdList: string[]
}[]) => defer(() => from(
request(`/jetlinks/tenant/${id}/assets/_unbind`, {
request(this.tenant === 'true' ? `/jetlinks/tenant/assets/_unbind` : `/jetlinks/tenant/${id}/assets/_unbind`, {
method: 'POST',
data
})).pipe(
Expand Down

0 comments on commit 85f5b40

Please sign in to comment.