weaver_trunk_cli/pc4mobx/hrm/util/py-util.js

30 lines
373 B
JavaScript
Raw Normal View History

2023-09-22 14:01:42 +08:00
import {
message,
} from 'antd';
const fetch = (params) => {
const {
Api,
name,
fetchParams = {},
logic,
} = params;
Api[name](fetchParams).then(cb => {
const {
api_status,
} = cb;
if (api_status) {
logic(cb);
} else {
message.error();
}
}).catch(error => {
message.error();
});
}
export {
fetch
}