From 9cd88345f048913941e05a12059e2e2238f0a754 Mon Sep 17 00:00:00 2001
From: gaoshp <291585735@qq.com>
Date: 星期一, 01 四月 2024 22:07:35 +0800
Subject: [PATCH] 更新进度
---
src/utils/request.js | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/utils/request.js b/src/utils/request.js
index 8834691..3295418 100644
--- a/src/utils/request.js
+++ b/src/utils/request.js
@@ -12,12 +12,13 @@
axios.interceptors.request.use(
(config) => {
let token = tool.cookie.get("TOKEN");
+ config.headers['Authorization'] = 'Basic c2FiZXI6c2FiZXJfc2VjcmV0'
if(token){
config.headers[sysConfig.TOKEN_NAME] = sysConfig.TOKEN_PREFIX + token
}
if(!sysConfig.REQUEST_CACHE && config.method == 'get'){
config.params = config.params || {};
- config.params['_'] = new Date().getTime();
+ // config.params['_'] = new Date().getTime();
}
Object.assign(config.headers, sysConfig.HEADERS)
return config;
@@ -140,10 +141,11 @@
*/
postJ: function(url, data={}, config={}) {
return new Promise((resolve, reject) => {
+ console.log(qsStringify(data))
axios({
method: 'post',
url: url,
- headers: { 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8','Authorization': 'Basic c2FiZXI6c2FiZXJfc2VjcmV0'},
+ headers: { 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'},
data: qsStringify(data),
...config
}).then((response) => {
@@ -203,7 +205,7 @@
axios({
method: 'delete',
url: url,
- data: data,
+ params: data,
...config
}).then((response) => {
resolve(response.data);
--
Gitblit v1.9.3