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