index-service.js
418 Bytes
/**
* Created by TaoHuang on 2016/6/21.
*/
const api = require('./index-api');
module.exports.getResourceAsync = (resourceCode) => {
return api.getResourceAsync(resourceCode)
.then(result => {
if (result.code === 200) {
return result.data;
} else {
return {};
}
})
.catch(() => {
return {};
});
};