From 0110b78419d98e114c59fa9fb6f69663fbdc3c98 Mon Sep 17 00:00:00 2001 From: 陈泽平 <chenzeping> Date: 星期日, 30 五月 2021 19:37:35 +0800 Subject: [PATCH] Merge branch 'develop' of http://xearth.cn:6600/r/wuyushui/SewerAndRainNetwork into develop --- src/utils/axios.js | 15 ++++++++------- 1 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/utils/axios.js b/src/utils/axios.js index b28575e..cca3604 100644 --- a/src/utils/axios.js +++ b/src/utils/axios.js @@ -83,7 +83,7 @@ // 鍒涘缓axios瀹炰緥 const Service = axios.create({ - timeout: 1000 + timeout: 1000 * 30 }) const CancelToken = axios.CancelToken @@ -117,10 +117,10 @@ // request鎷︽埅鍣� Service.interceptors.request.use( config => { - // 涓存椂杩藉姞 - // if ($store.state.user.account) { - // config.headers.account = $store.state.user.account - // } + // 涓存椂杩藉姞 + // if ($store.state.user.account) { + // config.headers.account = $store.state.user.account + // } const copyConfig = Object.assign({}, config) // copyConfig = filterOauthData(copyConfig) // showDebugInfo(copyConfig) @@ -191,11 +191,12 @@ params: $T.filterParams(params) }) } -$http.post = function (url, data = {}) { +$http.post = function (url, data = {}, setHeaders) { return Service({ url: url, method: 'post', - data: data + data: data, + headers: setHeaders || { 'Content-Type': 'application/json; charset=UTF-8' } }) } $http.put = function (url, data = {}) { -- Gitblit v1.8.0