From d08692a30af7805174c136b3e99e236e40fe8ca6 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Wed, 19 Jul 2023 18:24:47 +0800 Subject: [PATCH] =?UTF-8?q?feat=20=E7=94=A8=E6=88=B7=E5=A4=B4=E5=83=8F?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/account-setting/AccountSettingAccount.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/views/account-setting/AccountSettingAccount.vue b/src/views/account-setting/AccountSettingAccount.vue index 5fa87452..fec4b14c 100644 --- a/src/views/account-setting/AccountSettingAccount.vue +++ b/src/views/account-setting/AccountSettingAccount.vue @@ -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(); + } }; } };