From 3fc5c0b27d9d7eefc060ef2ba570ec0fc40405cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=99=E5=90=8C=E5=AD=A6?= <2495967527@qq.com> Date: Tue, 8 Oct 2024 15:59:29 +0800 Subject: [PATCH] add --- src/utils/httpRequest.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/utils/httpRequest.js b/src/utils/httpRequest.js index b5c86fe..15b2e25 100644 --- a/src/utils/httpRequest.js +++ b/src/utils/httpRequest.js @@ -35,18 +35,18 @@ http.interceptors.request.use( config => { config.headers["token"] =`Bearer ${Vue.cookie.get("token")}`; // 请求头带上token // 针对post请求加密 - if (config.method.toLowerCase() === "post" && process.env.NODE_ENV === "production" ) { - //如果已经转成字符串了,就不用再转了 - if (typeof config.data === "string") { - config.data = des.encryptByDES(config.data, "u48rE-RlGbua_K_m$*#z99lt"); - } else { - //否则要转一次 - config.data = des.encryptByDES( - JSON.stringify(config.data), - "u48rE-RlGbua_K_m$*#z99lt" - ); - } - } + // if (config.method.toLowerCase() === "post" && process.env.NODE_ENV === "production" ) { + // //如果已经转成字符串了,就不用再转了 + // if (typeof config.data === "string") { + // config.data = des.encryptByDES(config.data, "u48rE-RlGbua_K_m$*#z99lt"); + // } else { + // //否则要转一次 + // config.data = des.encryptByDES( + // JSON.stringify(config.data), + // "u48rE-RlGbua_K_m$*#z99lt" + // ); + // } + // } if (process.env.NODE_ENV !== "production") { console.log(`【请求】${config.url}`, config); }