mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 05:12:39 +00:00
19 lines
578 B
TypeScript
19 lines
578 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 {} as FastGPTConfigFileType;
|
|
|
|
const res = await MongoSystemConfigs.findOne({
|
|
type: SystemConfigsTypeEnum.fastgpt
|
|
}).sort({
|
|
createTime: -1
|
|
});
|
|
|
|
const config = res?.value || {};
|
|
|
|
return config as FastGPTConfigFileType;
|
|
};
|