From 3054bbce49457c82df9ad32523f3a0186e268d6f Mon Sep 17 00:00:00 2001 From: yangdelong <828900aaa> Date: 星期五, 28 五月 2021 21:17:08 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/develop' 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