请求修改

This commit is contained in:
zoujiandong
2023-09-25 16:25:23 +08:00
parent 1e42268963
commit c641332a17
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -19,9 +19,9 @@ service.interceptors.request.use(
// Store 必须在拦截器内部导入,在外部导入会显示 Pinia 未初始化
const store = useUserStore();
// 设置请求头部 Authorization
if(config.method=="put"){
config.headers['Content-Type'] = 'application/x-www-form-urlencoded'
}
// if(config.method=="put"){
// config.headers['Content-Type'] = 'application/x-www-form-urlencoded'
// }
if (store.token) {
config.headers['Authorization'] = 'Bearer ' + store.token;
//config.headers['Content-Type'] = 'multipart/form-data'