|
@@ -11,28 +11,28 @@ axios.defaults.headers.post["Content-Type"]=
|
|
|
|
|
|
|
|
|
|
// 请求拦截
|
|
// 请求拦截
|
|
-axios.interceptors.request.use(
|
|
|
|
- (config)=>{
|
|
|
|
- let token = sessionStorage.getItem('assess_token') || ''; //获取token
|
|
|
|
- // console.log(token);
|
|
|
|
- if(token !=''){
|
|
|
|
- config.headers={
|
|
|
|
- // 'assess_token':token,
|
|
|
|
- 'Authorization':token,
|
|
|
|
- "Content-type":"application/x-www-from-urlencoded"
|
|
|
|
- };
|
|
|
|
- console.log(config.headers);
|
|
|
|
- }
|
|
|
|
- // console.log(config);
|
|
|
|
- // config.data=qs.stringify(config.data) //序列化post参数
|
|
|
|
- // console.log(config.data);
|
|
|
|
- return config;
|
|
|
|
- },
|
|
|
|
- (error)=>{
|
|
|
|
- console.log("错误的传参");
|
|
|
|
- return Promise.reject(error)
|
|
|
|
- }
|
|
|
|
-)
|
|
|
|
|
|
+// axios.interceptors.request.use(
|
|
|
|
+// (config)=>{
|
|
|
|
+// let token = sessionStorage.getItem('assess_token') || ''; //获取token
|
|
|
|
+// // console.log(token);
|
|
|
|
+// if(token !=''){
|
|
|
|
+// config.headers={
|
|
|
|
+// // 'assess_token':token,
|
|
|
|
+// 'Authorization':token,
|
|
|
|
+// "Content-type":"application/x-www-from-urlencoded"
|
|
|
|
+// };
|
|
|
|
+// console.log(config.headers);
|
|
|
|
+// }
|
|
|
|
+// // console.log(config);
|
|
|
|
+// // config.data=qs.stringify(config.data) //序列化post参数
|
|
|
|
+// // console.log(config.data);
|
|
|
|
+// return config;
|
|
|
|
+// },
|
|
|
|
+// (error)=>{
|
|
|
|
+// console.log("错误的传参");
|
|
|
|
+// return Promise.reject(error)
|
|
|
|
+// }
|
|
|
|
+// )
|
|
|
|
|
|
// 响应拦截
|
|
// 响应拦截
|
|
axios.interceptors.response.use(
|
|
axios.interceptors.response.use(
|