v4.6.4-Outlink (#589)

This commit is contained in:
Archer
2023-12-12 14:42:20 +08:00
committed by GitHub
parent d2d7eac9e0
commit e18c79ca71
79 changed files with 1094 additions and 762 deletions

View File

@@ -1,7 +1,7 @@
import { GET } from '@fastgpt/service/common/api/plusRequest';
export const authTeamBalance = async (teamId: string) => {
if (global.systemEnv.pluginBaseUrl) {
if (global.systemEnv?.pluginBaseUrl) {
return GET('/support/permission/authBalance', { teamId });
}
return true;

View File

@@ -11,12 +11,14 @@ import { TeamMemberRoleEnum } from '@fastgpt/global/support/user/team/constant';
token: team owner and chat owner have all permissions
*/
export async function autChatCrud({
appId,
chatId,
shareId,
outLinkUid,
per = 'owner',
...props
}: AuthModeType & {
appId: string;
chatId?: string;
shareId?: string;
outLinkUid?: string;
@@ -28,7 +30,7 @@ export async function autChatCrud({
const isOutLink = Boolean(shareId && outLinkUid);
if (!chatId) return { isOutLink, uid: outLinkUid };
const chat = await MongoChat.findOne({ chatId }).lean();
const chat = await MongoChat.findOne({ appId, chatId }).lean();
if (!chat) return { isOutLink, uid: outLinkUid };

View File

@@ -2,6 +2,6 @@ import { POST } from '@fastgpt/service/common/api/plusRequest';
import { SendInformProps } from '@fastgpt/global/support/user/inform/type';
export function sendOneInform(data: SendInformProps) {
if (!global.systemEnv.pluginBaseUrl) return;
if (!global.systemEnv?.pluginBaseUrl) return;
return POST('/support/user/inform/create', data);
}

View File

@@ -8,7 +8,7 @@ import { defaultQGModels } from '@fastgpt/global/core/ai/model';
import { POST } from '@fastgpt/service/common/api/plusRequest';
export function createBill(data: CreateBillProps) {
if (!global.systemEnv.pluginBaseUrl) return;
if (!global.systemEnv?.pluginBaseUrl) return;
if (data.total === 0) {
addLog.info('0 Bill', data);
}
@@ -17,7 +17,7 @@ export function createBill(data: CreateBillProps) {
} catch (error) {}
}
export function concatBill(data: ConcatBillProps) {
if (!global.systemEnv.pluginBaseUrl) return;
if (!global.systemEnv?.pluginBaseUrl) return;
if (data.total === 0) {
addLog.info('0 Bill', data);
}