mirror of
https://github.com/labring/FastGPT.git
synced 2026-05-07 01:02:55 +08:00
sandbox version (#6497)
* sandbox version * add sandbox log * update lock * fix * fix: sandbox * doc * add console * i18n
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import { SandboxCodeTypeEnum } from '@fastgpt/global/core/workflow/template/system/sandbox/constants';
|
||||
import type { AxiosInstance } from 'axios';
|
||||
import axios from 'axios';
|
||||
import { getLogger, LogCategories } from '../../common/logger';
|
||||
const logger = getLogger(LogCategories.MODULE.WORKFLOW.CODE_SANDBOX);
|
||||
|
||||
export type SanndboxPackagesResponse = {
|
||||
js: string[];
|
||||
@@ -28,6 +30,7 @@ export class CodeSandbox {
|
||||
(response) => {
|
||||
const data = response.data;
|
||||
if (!data.success) {
|
||||
logger.warn('Request code sandbox failed', { data });
|
||||
return Promise.reject(new Error(data.message || 'Request code sandbox failed'));
|
||||
}
|
||||
return response.data;
|
||||
|
||||
Reference in New Issue
Block a user