1
0
mirror of synced 2026-03-24 03:38:34 +08:00

feat(core,data-source): 数据源支持mock

This commit is contained in:
roymondchen
2023-10-02 17:10:15 +08:00
parent 56dfacbaaa
commit 4c46a4e575
6 changed files with 38 additions and 19 deletions

View File

@@ -28,11 +28,11 @@ import DataSourceManager from './DataSourceManager';
* @param httpDataSourceOptions http 数据源配置
* @returns DataSourceManager
*/
export const createDataSourceManager = (app: AppCore) => {
export const createDataSourceManager = (app: AppCore, useMock?: boolean) => {
const { dsl, platform } = app;
if (!dsl?.dataSources) return;
const dataSourceManager = new DataSourceManager({ app });
const dataSourceManager = new DataSourceManager({ app, useMock });
if (dsl.dataSources && dsl.dataSourceCondDeps && platform !== 'editor') {
getNodes(getDepNodeIds(dsl.dataSourceCondDeps), dsl.items).forEach((node) => {