From 115a6ae906c22af00efa6734a129ca6500be001c Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 21 一月 2021 19:00:51 +0800 Subject: [PATCH] 2021-01-21 --- src/api/index.js | 40 ++++++++++++++++++++++++++++++++++++++-- 1 files changed, 38 insertions(+), 2 deletions(-) diff --git a/src/api/index.js b/src/api/index.js index fc1607a..250e277 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -41,12 +41,11 @@ axios.defaults.withCredentials = true axios.interceptors.request.use((config) => { - config.method = 'post' if (config.url.includes('LoginAndRedirect') || config.url.includes('getjsonresult') || config.url.includes('wxNativePay')) { config.data = qs.stringify(config.data) } else if (config.url.includes('Upload') || config.url.includes('doupload') || config.url.includes('dopreload')) { config.headers = { 'Content-Type': 'multipart/form-data' } - } else { + } else if (config.method === 'post') { // config.headers.token = sessionStorage.getItem('TOKEN') || '' config.data = JSON.stringify(config.data) } @@ -112,7 +111,21 @@ return axios({ url: '/webapi/dostar', + method: 'post', data: param + }) + } + + /** + * @description 鐩存帴璇锋眰 + * @param {Object} param 鏌ヨ鍙婃彁浜ゅ弬鏁� + */ + directRequest (url, method, param) { + + return axios({ + url: url, + method: method, + params: param }) } @@ -128,6 +141,7 @@ return axios({ url: '/webapi/dostar', + method: 'post', data: param }) } @@ -161,6 +175,7 @@ return axios({ url: '/webapi/dologon', + method: 'post', data: param }) } @@ -192,6 +207,7 @@ return axios({ url: '/webapi/dologon', + method: 'post', data: param }) } @@ -222,6 +238,7 @@ return axios({ url: '/webapi/dologon', + method: 'post', data: param }) } @@ -284,6 +301,7 @@ return new Promise((resolve, reject) => { axios({ url: `/webapi/dostars${param.func ? '/' + param.func : ''}`, + method: 'post', data: param }).then(res => { if (!res.status) { @@ -414,6 +432,7 @@ return axios({ url: `/webapi/dostars${param.func ? '/' + param.func : ''}`, + method: 'post', data: param }) } @@ -454,6 +473,7 @@ return new Promise(resolve => { axios({ url: `/webapi/dostars${param.func ? '/' + param.func : ''}`, + method: 'post', data: param }).then(res => { if (res.status) { @@ -487,6 +507,7 @@ return axios({ url: `/webapi/dostars${param.func ? '/' + param.func : ''}`, + method: 'post', data: param }) } @@ -505,6 +526,7 @@ return axios({ url: `/webapi/dostars${param.func ? '/' + param.func : ''}`, + method: 'post', data: param }) } @@ -558,6 +580,7 @@ } else { axios({ url: `/webapi/dostars${param.func ? '/' + param.func : ''}`, + method: 'post', data: param }).then(res => { if (res.status) { @@ -572,6 +595,7 @@ axios({ url: `/webapi/dostars${param.func ? '/' + param.func : ''}`, + method: 'post', data: param }).then(res => { if (res.status) { @@ -590,6 +614,7 @@ return new Promise(resolve => { axios({ url: `/webapi/dostars${param.func ? '/' + param.func : ''}`, + method: 'post', data: param }).then(res => { if (res.status) { @@ -702,6 +727,7 @@ return new Promise(resolve => { axios({ url: `/webapi/dostars${param.func ? '/' + param.func : ''}`, + method: 'post', data: param }).then(res => { if (res.status) { @@ -732,6 +758,7 @@ return axios({ url: `/webapi/dostars${param.func ? '/' + param.func : ''}`, + method: 'post', data: param }) } @@ -750,6 +777,7 @@ axios({ url: '/webapi/doexcel', responseType: 'blob', + method: 'post', data: param }).then(res => { @@ -821,11 +849,13 @@ return axios({ url: '/webapi/dostars', + method: 'post', data: param }) } else { return axios({ url: '/webapi/SaveBase64Image', + method: 'post', data: param }) } @@ -837,6 +867,7 @@ getLargeFileUpload (param) { return axios({ url: '/webapi/doupload', + method: 'post', data: param }) } @@ -847,6 +878,7 @@ getFilePreUpload (param) { return axios({ url: '/webapi/dopreload', + method: 'post', data: param }) } @@ -857,6 +889,7 @@ getWxNativePay (param) { return axios({ url: '/wxpay/wxNativePay', + method: 'post', data: param }) } @@ -867,6 +900,7 @@ getFileUpload (param) { return axios({ url: '/zh-CN/Home/Upload', + method: 'post', data: param }) } @@ -885,6 +919,7 @@ return axios({ url: '/webapi/dostar', + method: 'post', data: param }) } @@ -901,6 +936,7 @@ return axios({ url: '/webapi/dostar', + method: 'post', data: param }) } -- Gitblit v1.8.0