4.6.7-alpha commit (#743)

Co-authored-by: Archer <545436317@qq.com>
Co-authored-by: heheer <71265218+newfish-cmyk@users.noreply.github.com>
This commit is contained in:
Archer
2024-01-19 11:17:28 +08:00
committed by GitHub
parent 8ee7407c4c
commit c031e6dcc9
324 changed files with 8509 additions and 4757 deletions

View File

@@ -1,7 +1,7 @@
import { AuthResponseType } from '@fastgpt/global/support/permission/type';
import { AuthModeType } from '../type';
import { parseHeaderCert } from '../controller';
import { getTeamInfoByTmbId } from '../../user/team/controller';
import { getTmbInfoByTmbId } from '../../user/team/controller';
import { TeamMemberRoleEnum } from '@fastgpt/global/support/user/team/constant';
import { MongoPlugin } from '../../../core/plugin/schema';
import { PluginErrEnum } from '@fastgpt/global/common/error/code/plugin';
@@ -23,7 +23,7 @@ export async function authPluginCrud({
const result = await parseHeaderCert(props);
const { tmbId, teamId } = result;
const { role } = await getTeamInfoByTmbId({ tmbId });
const { role } = await getTmbInfoByTmbId({ tmbId });
const { plugin, isOwner, canWrite } = await (async () => {
const plugin = await MongoPlugin.findOne({ _id: id, teamId });
@@ -73,7 +73,7 @@ export async function authPluginCanUse({
}
if (source === PluginSourceEnum.personal) {
const { role } = await getTeamInfoByTmbId({ tmbId });
const { role } = await getTmbInfoByTmbId({ tmbId });
const plugin = await MongoPlugin.findOne({ _id: pluginId, teamId });
if (!plugin) {
return Promise.reject(PluginErrEnum.unExist);