| | |
| | | |
| | | const GetDataAsynByUrl = async (oUrl, pData) => { |
| | | const pUrl = encodeURI(oUrl) |
| | | const res = await axios({ |
| | | method: 'get', |
| | | url: pUrl, |
| | | data: pData |
| | | const res = await axios.get(pUrl, { |
| | | params: pData |
| | | }).then((response) => { |
| | | return (response) |
| | | }) |
| | | .catch((error) => { |
| | | console.error('数据获取失败', error) |
| | | }) |
| | | return res |
| | | |
| | | // $.ajax({ |
| | | // type: 'GET', |
| | | // url: pUrl, |
| | | // data: pData, |
| | | // timeout: 600000, |
| | | // async: true, |
| | | // success: function (datas, nnn) { |
| | | // pBackFun(datas) |
| | | // }, |
| | | // error: function (e, nnnn) { |
| | | // console.error('数据获取失败', pUrl) |
| | | // } |
| | | // }) |
| | | return res.data |
| | | } |
| | | function postDataAsynByUrl (pUrl, pData, pBackFun) { |
| | | $.ajax({ |