fix:async await fetch img
This commit is contained in:
parent
50b9ed9d35
commit
8cef8d6fc8
1 changed files with 3 additions and 3 deletions
|
|
@ -177,7 +177,7 @@ async function fetchKeycloakPosition() {
|
||||||
privacyStore.setAccepted(data.privacyCheckin)
|
privacyStore.setAccepted(data.privacyCheckin)
|
||||||
//เช็คว่ามีรูปไหม ถ้ามีรูปเรียกข้อมูลรูป
|
//เช็คว่ามีรูปไหม ถ้ามีรูปเรียกข้อมูลรูป
|
||||||
if (data.avatarName) {
|
if (data.avatarName) {
|
||||||
await getImg(data.profileId, data.avatarName)
|
getImg(data.profileId, data.avatarName)
|
||||||
} else {
|
} else {
|
||||||
profileImg.value = avatar
|
profileImg.value = avatar
|
||||||
}
|
}
|
||||||
|
|
@ -188,8 +188,8 @@ async function fetchKeycloakPosition() {
|
||||||
}
|
}
|
||||||
|
|
||||||
const profileImg = ref<string>('')
|
const profileImg = ref<string>('')
|
||||||
async function getImg(id: string, pathName: string) {
|
function getImg(id: string, pathName: string) {
|
||||||
await http
|
http
|
||||||
.get(config.API.fileByFile('ทะเบียนประวัติ', 'โปรไฟล์', id, pathName))
|
.get(config.API.fileByFile('ทะเบียนประวัติ', 'โปรไฟล์', id, pathName))
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
profileImg.value = res.data.downloadUrl
|
profileImg.value = res.data.downloadUrl
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue