Reactjs 可能的未处理承诺拒绝:错误:操作必须是普通对象。使用自定义中间件进行异步操作
我有一个函数,用于根据设置的输入执行各种异步操作。以下是我的功能: const generalpirequest=requestUrl,urlType,data={},actionDispatch=>{ 返回函数dispatch,getState{ 控制台。日志调度; adminId=getState.authentication.adminId; token=getState.authentication.token; 返回hitUrlrequestUrl、urlType、dispatch、data。然后返回Response=>{ 试一试{ ifresponse.status==200{ //dispatchactionDispatchresponse.data; 行动调度; } 否则{ console.Log错误响应,响应; ifresponse.status==401{ 日志“再次登录,身份验证失败”; 调度失败; } } } 捕捉错误{ console.logerror; } } ,error=>{console.logerror} }Reactjs 可能的未处理承诺拒绝:错误:操作必须是普通对象。使用自定义中间件进行异步操作,reactjs,react-redux,dispatch,Reactjs,React Redux,Dispatch,我有一个函数,用于根据设置的输入执行各种异步操作。以下是我的功能: const generalpirequest=requestUrl,urlType,data={},actionDispatch=>{ 返回函数dispatch,getState{ 控制台。日志调度; adminId=getState.authentication.adminId; token=getState.authentication.token; 返回hitUrlrequestUrl、urlType、dispatch、
}; 您的ProcessAppender设置不正确
export const processApplicant = (data) => {
return (dispatch) => {
let requestUrl;
let urlType = "post";
let message;
message = "The user has been successfully deleted"
requestUrl = apiUrl + 'application/process/delete';
let actionDispatch = triggerSuccess(message);
dispatch(generalApiRequest(requestUrl, urlType, data, actionDispatch));
}
}