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 http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
import { checkPermissionGet } from "@/utils/permissions";
|
import { checkPermissionGet } from "@/utils/permissions";
|
||||||
|
import avatarMain from "@/assets/avatar_user.jpg";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* importCOmponents
|
* importCOmponents
|
||||||
|
|
@ -50,11 +51,14 @@ function fetchInformation() {
|
||||||
.get(config.API.orgProfileById(profileId.value, props.employeeClass))
|
.get(config.API.orgProfileById(profileId.value, props.employeeClass))
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
|
|
||||||
fullName.value = `${data.prefix}${data.firstName} ${data.lastName}`;
|
fullName.value = `${data.prefix}${data.firstName} ${data.lastName}`;
|
||||||
position.value = data.position;
|
position.value = data.position;
|
||||||
|
|
||||||
if (data.avatarName) {
|
if (data.avatarName) {
|
||||||
await fetchProfile(data.id as string, data.avatarName);
|
await fetchProfile(data.id as string, data.avatarName);
|
||||||
|
} else {
|
||||||
|
avatar.value = avatarMain;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
|
@ -72,6 +76,9 @@ async function fetchProfile(id: string, avatarName: string) {
|
||||||
.get(config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, avatarName))
|
.get(config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, avatarName))
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
avatar.value = res.data.downloadUrl;
|
avatar.value = res.data.downloadUrl;
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
avatar.value = avatarMain;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue