{"size": 422, "ext": "js", "max_stars_repo_path": "app/src/utils/request.js", "max_stars_repo_name": "dreamboys900828/LearnReact", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "app/src/utils/request.js", "max_issues_repo_name": "dreamboys900828/LearnReact", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "app/src/utils/request.js", "max_forks_repo_name": "dreamboys900828/LearnReact", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 23.4444444444, "max_line_length": 62, "alphanum_fraction": 0.509478673}
import axios from "axios";

export const getData = (url = '', data = {}) => {
    let dataStr = ''; //数据拼接字符串
    Object.keys(data).forEach(key => {
        dataStr += key + '=' + data[key] + '&';
    });

    if (dataStr !== '') {
        dataStr = dataStr.substr(0, dataStr.lastIndexOf('&'));
        url = url + '?' + dataStr;
    }
    return axios.get(url)
}

export const postData = () => {
    return axios.post()
}