feat(data-sources): http数据裁剪函数content参数添加options
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user