修改文件上传

This commit is contained in:
haozq 2024-07-02 10:27:49 +08:00
parent 3e1ab1d75b
commit abdc58312c
2 changed files with 11 additions and 8 deletions

View File

@ -104,6 +104,9 @@ export function updateUserPwd(oldPassword, newPassword) {
export function uploadAvatar(data) {
return request({
url: '/system/user/profile/avatar',
headers: {
'Content-Type': 'multipart/form-data'
},
method: 'post',
data: data
})

View File

@ -32,14 +32,14 @@ service.interceptors.request.use(config => {
// return Promise.reject('无效的会话,或者会话已过期,请重新登录。')
// get请求映射params参数
if (config.method === 'get' && config.params) {
let param=tansParams(config.params);
if(param){
param = param.slice(0, -1);
param=encryptCBC(param);
}
let url = config.url + '?' + param;
config.params = {};
config.url = url;
let param=tansParams(config.params);
if(param){
param = param.slice(0, -1);
param=encryptCBC(param);
}
let url = config.url + '?' + param;
config.params = {};
config.url = url;
}
if (!isRepeatSubmit && (config.method === 'post' || config.method === 'put')) {