我正在尝试从服务返回的<core:FragmentDefinition xmlns="sap.m" xmlns:core="sap.ui.core">
<ViewSettingsDialog >
<filterItems>
<ViewSettingsFilterItem>
<items>
<ViewSettingsItem text="{Status}" key="{sId}"/>
</items>
</ViewSettingsFilterItem>
</filterItems>
</ViewSettingsDialog>
</core:FragmentDefinition>
动作的响应。这些是我的项目的一些片段。
redux-saga
// ACTION
const actions = {
LOAD_CURRENT_ACCOUNT: 'user/LOAD_CURRENT_ACCOUNT'
};
export const currentUser = () => ({
type: actions.LOAD_CURRENT_ACCOUNT
});
// SERVICE
export async function currentAccount() {
try {
const url = config.endpoints.user;
const res = await http.get(url);
return res.data;
} catch (err) {
if (err.response && err.response.data) {
notification.warning({
message: err.response.data.code,
description: err.response.data.message
});
}
return false;
}
}
现在,当我尝试记录响应时,它仅返回操作类型对象,即// SAGA
export function* LOAD_CURRENT_ACCOUNT() {
const res = yield call(currentAccount);
if (res) {
yield put({
type: actions.SET_STATE,
payload: res.data
});
}
}
而不是我期望API响应的输出。
"user/LOAD_CURRENT_ACCOUNT"
如何在此处获取API响应?