add
continuous-integration/drone/push Build was killed
Details
continuous-integration/drone/push Build was killed
Details
This commit is contained in:
parent
0ad0c4cf99
commit
3fc5c0b27d
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue