import axios from "axios"; const API_MXD = '/mxd'; const URL = { example: API_MXD + "/subs/active/list", }; class Api { static doGet(url, success, error, tokenData) { axios.get(url) .then((msg) => { let data = msg.data; success(JSON.parse(data)) }) .catch((error) => { console.log(error); }) } static doPost(url, bodyType, bodyData, success, error) { axios.post(url, bodyData) .then((msg) => { let data = msg.data; success(JSON.parse(data)) }) .catch((error) => { // console.log(error); }) } /** * 示例 * @param success * @param error */ static example(success, error) { this.doGet(URL.example, success, error,"") } } export default Api