fix เครื่องราช
This commit is contained in:
parent
460f133b3e
commit
dd43246ebe
1 changed files with 7 additions and 0 deletions
|
|
@ -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;
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue