mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:48:45 +08:00
fix:ajax动作responseData配置失效问题
This commit is contained in:
parent
de7d67981e
commit
810dc89989
@ -259,7 +259,10 @@ run action ajax
|
||||
args: {
|
||||
api: {
|
||||
url: 'https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/mock2/form/saveForm?name=${name}',
|
||||
method: 'get'
|
||||
method: 'get',
|
||||
"responseData": {
|
||||
"resId": "${id}"
|
||||
}
|
||||
},
|
||||
messages: {
|
||||
success: '成功了!欧耶',
|
||||
|
@ -186,7 +186,7 @@ export const runAction = async (
|
||||
event
|
||||
};
|
||||
|
||||
// $$默认为renderer.props.data,兼容表单项值变化时的data读取
|
||||
// __rendererData默认为renderer.props.data,兼容表单项值变化时的data读取
|
||||
if (!event.data.__rendererData) {
|
||||
additional = {
|
||||
event,
|
||||
@ -223,7 +223,9 @@ export const runAction = async (
|
||||
|
||||
// 动作配置
|
||||
const args = dataMapping(actionConfig.args, mergeData, key =>
|
||||
['adaptor', 'responseAdaptor', 'requestAdaptor'].includes(key)
|
||||
['adaptor', 'responseAdaptor', 'requestAdaptor', 'responseData'].includes(
|
||||
key
|
||||
)
|
||||
);
|
||||
const afterMappingData = dataMapping(actionConfig.data, mergeData);
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
import omit from 'lodash/omit';
|
||||
import {Api, ApiObject} from '../types';
|
||||
import {normalizeApiResponseData} from '../utils/api';
|
||||
import {ServerError} from '../utils/errors';
|
||||
@ -54,7 +53,7 @@ export class AjaxAction implements RendererAction {
|
||||
const env = event.context.env;
|
||||
try {
|
||||
const result = await env.fetcher(
|
||||
action.args?.api as string,
|
||||
action.args?.api,
|
||||
action.data ?? {},
|
||||
action.args?.options ?? {}
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user