add
continuous-integration/drone/push Build was killed Details

This commit is contained in:
余同学 2024-10-08 15:59:29 +08:00
parent 0ad0c4cf99
commit 3fc5c0b27d
1 changed files with 12 additions and 12 deletions

View File

@ -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);
}