fix: 上传接口变更
This commit is contained in:
@@ -114,13 +114,13 @@ function fnUpload(up: UploadRequestOption) {
|
||||
if (filePath === '') return undefined;
|
||||
const form = toRaw(stateForm.form);
|
||||
form.avatar = filePath;
|
||||
uerStore.setAvatar(filePath);
|
||||
return updateUserProfile(form);
|
||||
})
|
||||
.then(res => {
|
||||
if (res === undefined) return;
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success(t('views.account.settings.uploadOk'), 3);
|
||||
uerStore.setAvatar(res.data);
|
||||
} else {
|
||||
message.error(res.msg, 3);
|
||||
}
|
||||
@@ -257,6 +257,7 @@ onMounted(() => {
|
||||
<a-upload
|
||||
name="file"
|
||||
list-type="picture"
|
||||
accept=".jpg,.png"
|
||||
:max-count="1"
|
||||
:show-upload-list="false"
|
||||
:before-upload="fnBeforeUpload"
|
||||
|
||||
Reference in New Issue
Block a user