import { Item } from 'ant-design-vue/lib/menu';
import axios from 'axios';

const url = 'https://yongma16.xyz/common-api/getCsdnGrade/'

const aliDevUrl='https://developer.aliyun.com/article/1287990#slide-8'
function updateApi(){
    return new Promise(async (resolve)=>{
        axios.get(aliDevUrl)
        resolve(true)
    })
}
export function getRemoteCsdnGrade(data){
    return axios.post(url, data, { timeout: 100000 })
}

export function getRemoteCsdnCommit(params){
    const urlParams=Object.keys(params).map(key=>{
        return `${key}=${params[key]}`
    }).join('&')
    return axios.get('https://yongma16.xyz/common-api/getCsdnCommit/'+'?'+urlParams, { timeout: 100000 })
}

export const askGpt = (params) => {
    return axios.post("https://yongma16.xyz/common-api/get_baidu_gpt/", params);
};