mirror of
https://github.com/labring/FastGPT.git
synced 2025-08-01 03:48:24 +00:00
Permission (#1687)
Co-authored-by: Archer <545436317@qq.com> Co-authored-by: Finley Ge <32237950+FinleyGe@users.noreply.github.com>
This commit is contained in:
15
projects/app/src/web/core/app/api/collaborator.ts
Normal file
15
projects/app/src/web/core/app/api/collaborator.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import {
|
||||
UpdateAppCollaboratorBody,
|
||||
AppCollaboratorDeleteParams
|
||||
} from '@fastgpt/global/core/app/collaborator';
|
||||
import { DELETE, GET, POST } from '@/web/common/api/request';
|
||||
import { CollaboratorItemType } from '@fastgpt/global/support/permission/collaborator';
|
||||
|
||||
export const getCollaboratorList = (appId: string) =>
|
||||
GET<CollaboratorItemType[]>('/proApi/core/app/collaborator/list', { appId });
|
||||
|
||||
export const postUpdateAppCollaborators = (body: UpdateAppCollaboratorBody) =>
|
||||
POST('/proApi/core/app/collaborator/update', body);
|
||||
|
||||
export const deleteAppCollaborators = ({ ...params }: AppCollaboratorDeleteParams) =>
|
||||
DELETE('/proApi/core/app/collaborator/delete', { ...params });
|
@@ -1,5 +1,7 @@
|
||||
import { AppDetailType } from '@fastgpt/global/core/app/type.d';
|
||||
import type { FeishuType, OutLinkEditType } from '@fastgpt/global/support/outLink/type.d';
|
||||
import { AppPermission } from '@fastgpt/global/support/permission/app/controller';
|
||||
import { NullPermission } from '@fastgpt/global/support/permission/constant';
|
||||
|
||||
export const defaultApp: AppDetailType = {
|
||||
_id: '',
|
||||
@@ -12,12 +14,11 @@ export const defaultApp: AppDetailType = {
|
||||
chatConfig: {},
|
||||
teamId: '',
|
||||
tmbId: '',
|
||||
permission: 'private',
|
||||
isOwner: false,
|
||||
canWrite: false,
|
||||
teamTags: [],
|
||||
edges: [],
|
||||
version: 'v2'
|
||||
version: 'v2',
|
||||
defaultPermission: NullPermission,
|
||||
permission: new AppPermission()
|
||||
};
|
||||
|
||||
export const defaultOutLinkForm: OutLinkEditType = {
|
||||
|
@@ -11,7 +11,7 @@ import {
|
||||
} from '@fastgpt/global/support/user/team/controller.d';
|
||||
import type { TeamTagItemType, TeamTagSchema } from '@fastgpt/global/support/user/team/type';
|
||||
import {
|
||||
TeamItemType,
|
||||
TeamTmbItemType,
|
||||
TeamMemberItemType,
|
||||
TeamMemberSchema
|
||||
} from '@fastgpt/global/support/user/team/type.d';
|
||||
@@ -19,7 +19,7 @@ import { FeTeamPlanStatusType, TeamSubSchema } from '@fastgpt/global/support/wal
|
||||
|
||||
/* --------------- team ---------------- */
|
||||
export const getTeamList = (status: `${TeamMemberSchema['status']}`) =>
|
||||
GET<TeamItemType[]>(`/proApi/support/user/team/list`, { status });
|
||||
GET<TeamTmbItemType[]>(`/proApi/support/user/team/list`, { status });
|
||||
export const postCreateTeam = (data: CreateTeamProps) =>
|
||||
POST<string>(`/proApi/support/user/team/create`, data);
|
||||
export const putUpdateTeam = (data: UpdateTeamProps) => PUT(`/support/user/team/update`, data);
|
||||
@@ -39,8 +39,12 @@ export const updateInviteResult = (data: UpdateInviteProps) =>
|
||||
PUT('/proApi/support/user/team/member/updateInvite', data);
|
||||
export const delLeaveTeam = (teamId: string) =>
|
||||
DELETE('/proApi/support/user/team/member/leave', { teamId });
|
||||
|
||||
/* -------------- team collaborator -------------------- */
|
||||
export const updateMemberPermission = (data: UpdateTeamMemberPermissionProps) =>
|
||||
PUT('/proApi/support/user/team/member/updatePermission', data);
|
||||
PUT('/proApi/support/user/team/collaborator/update', data);
|
||||
export const delMemberPermission = (tmbId: string) =>
|
||||
DELETE('/proApi/support/user/team/collaborator/delete', { tmbId });
|
||||
|
||||
/* --------------- team tags ---------------- */
|
||||
export const getTeamsTags = () => GET<TeamTagSchema[]>(`/proApi/support/user/team/tag/list`);
|
||||
|
Reference in New Issue
Block a user