From 7df2d3d0fa20cd1eb58009aaf6e1b3c8712a58a2 Mon Sep 17 00:00:00 2001 From: chenyabin <Chenab123!> Date: 星期二, 20 四月 2021 16:02:59 +0800 Subject: [PATCH] 图层控制宽度限制 --- src/utils/AjaxUtils.js | 24 ++++-------------------- 1 files changed, 4 insertions(+), 20 deletions(-) diff --git a/src/utils/AjaxUtils.js b/src/utils/AjaxUtils.js index 0499763..b99fd67 100644 --- a/src/utils/AjaxUtils.js +++ b/src/utils/AjaxUtils.js @@ -33,7 +33,7 @@ axios({ method: 'get', url: pUrl, - data: pData + params: pData }).then(function (response) { pBackFun(response) }) @@ -44,31 +44,15 @@ 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({ -- Gitblit v1.8.0