This commit is contained in:
setthawutttty 2024-11-06 16:47:02 +07:00
parent 8390a8ab01
commit 8c989e84b2
23 changed files with 201 additions and 149 deletions

View file

@ -47,16 +47,16 @@ onMounted(async () => {
});
async function checkUser() {
http
await http
.get(config.API.profilePosition())
.then(async (res) => {
const data = res.data.result;
dataStore.isProbation = data.isProbation;
dataStore.officerType = data.type;
const data = await res.data.result;
await dataStore.getData(data);
if (data.avatarName) {
await getImg(data.profileId, data.avatarName);
} else {
profileImg.value = avatar;
dataStore.profileImg = avatar;
}
})
.catch((err) => {
@ -84,6 +84,7 @@ function getImg(id: string, pathName: string) {
.get(config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, pathName))
.then((res) => {
profileImg.value = res.data.downloadUrl;
dataStore.profileImg = res.data.downloadUrl;
})
.catch((e) => {
// messageError($q, e);