fix:async await fetch img

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2026-01-29 11:42:52 +07:00
parent 50b9ed9d35
commit 8cef8d6fc8

View file

@ -177,7 +177,7 @@ async function fetchKeycloakPosition() {
privacyStore.setAccepted(data.privacyCheckin)
//
if (data.avatarName) {
await getImg(data.profileId, data.avatarName)
getImg(data.profileId, data.avatarName)
} else {
profileImg.value = avatar
}
@ -188,8 +188,8 @@ async function fetchKeycloakPosition() {
}
const profileImg = ref<string>('')
async function getImg(id: string, pathName: string) {
await http
function getImg(id: string, pathName: string) {
http
.get(config.API.fileByFile('ทะเบียนประวัติ', 'โปรไฟล์', id, pathName))
.then((res) => {
profileImg.value = res.data.downloadUrl