mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-21 11:43:56 +00:00

* pr code * perf: model table show * perf: model provider show * perf: get init data buffer * perf: get init data buffer * perf: icon
27 lines
704 B
TypeScript
27 lines
704 B
TypeScript
import { SystemConfigsTypeEnum } from '@fastgpt/global/common/system/config/constants';
|
|
import { MongoSystemConfigs } from './schema';
|
|
import { FastGPTConfigFileType } from '@fastgpt/global/common/system/types';
|
|
import { FastGPTProUrl } from '../constants';
|
|
|
|
export const getFastGPTConfigFromDB = async () => {
|
|
if (!FastGPTProUrl) {
|
|
return {
|
|
config: {} as FastGPTConfigFileType,
|
|
configId: undefined
|
|
};
|
|
}
|
|
|
|
const res = await MongoSystemConfigs.findOne({
|
|
type: SystemConfigsTypeEnum.fastgpt
|
|
}).sort({
|
|
createTime: -1
|
|
});
|
|
|
|
const config = res?.value || {};
|
|
|
|
return {
|
|
configId: res ? String(res._id) : undefined,
|
|
config: config as FastGPTConfigFileType
|
|
};
|
|
};
|