mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-05 23:56:42 +08:00
feat 用户头像修改
This commit is contained in:
@@ -44,11 +44,13 @@ const changeAvatar = (file: Event) => {
|
|||||||
const fileReader = new FileReader();
|
const fileReader = new FileReader();
|
||||||
const { files } = file.target as HTMLInputElement;
|
const { files } = file.target as HTMLInputElement;
|
||||||
|
|
||||||
if (files && files.length) {
|
if (files && files.length > 0) {
|
||||||
fileReader.readAsDataURL(files[0]);
|
fileReader.readAsDataURL(files[0]);
|
||||||
fileReader.onload = () => {
|
fileReader.onload = () => {
|
||||||
if (typeof fileReader.result === "string")
|
if (typeof fileReader.result === "string") {
|
||||||
accountInfo.value.avatar = fileReader.result;
|
accountInfo.value.avatar = fileReader.result;
|
||||||
|
saveAccountInfo();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user