service.js
616 Bytes
import { GET, POST } from '../../../libs/request';
import { API_HOST} from '../../../libs/config';
class Service {
constructor(url = '') {
this.url = url;
}
_get(path, data) {
let method = path ? this.url + path : API_HOST;
return GET(method, data).then(result => {
if (result.code !== 200) {
} else {
}
return result
});
}
_post(path, data) {
let method = path ? this.url + path : API_HOST;
return POST(method, data).then(result => {
if (result.code !== 200) {
} else {
}
return result;
});
}
}
export default Service;