fix: 上传接口变更

This commit is contained in:
TsMask
2025-02-26 11:12:06 +08:00
parent 7429a55734
commit 5a61fc355e
13 changed files with 47 additions and 26 deletions

View File

@@ -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"