fix: 事件动作中download兼容问题

This commit is contained in:
wutong25 2023-08-17 19:10:45 +08:00
parent 7ef1842ed2
commit 9fbc3f86ef

View File

@ -97,6 +97,7 @@ const getOmitActionProp = (type: string) => {
omitList = ['msg', 'title'];
break;
case 'ajax':
case 'download':
omitList = ['api', 'messages', 'options'];
break;
case 'setValue':
@ -263,7 +264,7 @@ export const runAction = async (
} else if (action.actionType === 'drawer') {
action.drawer = {...(action.drawer ?? action.args?.drawer)};
delete action.args?.drawer;
} else if (action.actionType === 'ajax') {
} else if (['ajax', 'download'].includes(action.actionType)) {
const api = action.api ?? action.args?.api;
action.api = typeof api === 'string' ? api : {...api};
action.options = {...(action.options ?? action.args?.options)};