mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-04-06 03:57:56 +08:00
feat(data-sources): http数据裁剪函数content参数添加options
This commit is contained in:
parent
979d6e2e31
commit
5549e8cff9
@ -148,7 +148,7 @@ export default class HttpDataSource extends DataSource {
|
||||
}
|
||||
|
||||
if (typeof this.schema.afterResponse === 'function') {
|
||||
res = this.schema.afterResponse(res, { app: this.app, dataSource: this });
|
||||
res = this.schema.afterResponse(res, { app: this.app, dataSource: this, options: reqOptions });
|
||||
}
|
||||
|
||||
if (this.schema.responseOptions?.dataPath) {
|
||||
|
@ -21,7 +21,9 @@ export interface HttpDataSourceSchema extends DataSourceSchema {
|
||||
beforeRequest:
|
||||
| string
|
||||
| ((options: HttpOptions, content: { app: AppCore; dataSource: HttpDataSource }) => HttpOptions);
|
||||
afterResponse: string | ((response: any, content: { app: AppCore; dataSource: HttpDataSource }) => any);
|
||||
afterResponse:
|
||||
| string
|
||||
| ((response: any, content: { app: AppCore; dataSource: HttpDataSource; options: Partial<HttpOptions> }) => any);
|
||||
}
|
||||
|
||||
export interface DataSourceManagerOptions {
|
||||
|
Loading…
x
Reference in New Issue
Block a user