From dd43246ebeefe6c01698078331a443a03615c51e Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 7 Jan 2025 11:41:51 +0700 Subject: [PATCH] =?UTF-8?q?fix=20=E0=B9=80=E0=B8=84=E0=B8=A3=E0=B8=B7?= =?UTF-8?q?=E0=B9=88=E0=B8=AD=E0=B8=87=E0=B8=A3=E0=B8=B2=E0=B8=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/13_salary/components/DialogInfoMain.vue | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/modules/13_salary/components/DialogInfoMain.vue b/src/modules/13_salary/components/DialogInfoMain.vue index 4ff5b1af6..07ad36c05 100644 --- a/src/modules/13_salary/components/DialogInfoMain.vue +++ b/src/modules/13_salary/components/DialogInfoMain.vue @@ -5,6 +5,7 @@ import { useRouter } from "vue-router"; import http from "@/plugins/http"; import config from "@/app.config"; import { checkPermissionGet } from "@/utils/permissions"; +import avatarMain from "@/assets/avatar_user.jpg"; /** * importCOmponents @@ -50,11 +51,14 @@ function fetchInformation() { .get(config.API.orgProfileById(profileId.value, props.employeeClass)) .then(async (res) => { const data = res.data.result; + fullName.value = `${data.prefix}${data.firstName} ${data.lastName}`; position.value = data.position; if (data.avatarName) { await fetchProfile(data.id as string, data.avatarName); + } else { + avatar.value = avatarMain; } }) .catch((err) => { @@ -72,6 +76,9 @@ async function fetchProfile(id: string, avatarName: string) { .get(config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, avatarName)) .then(async (res) => { avatar.value = res.data.downloadUrl; + }) + .catch(() => { + avatar.value = avatarMain; }); }