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