diff --git a/src/App.vue b/src/App.vue index bbaafb9918..bff318470a 100644 --- a/src/App.vue +++ b/src/App.vue @@ -30,6 +30,7 @@ export default { return this.$store.getters['user/getRole'] }, getResourceName() { + if (this.isEmptyValue(this.getRole) && this.isEmptyValue(this.getRole.client)) return '' return this.$store.getters['user/getRole'].client.logo } }, @@ -40,7 +41,7 @@ export default { }, async mounted() { const { client } = this.getRole - if (client.logo) { + if (!this.isEmptyValue(client) && !this.isEmptyValue(client.logo)) { const fileName = await getResourcePath({ clientId: client.id, containerId: '109', diff --git a/src/layout/components/ProfilePreview.vue b/src/layout/components/ProfilePreview.vue index a73cb6b62f..e50fab0d55 100644 --- a/src/layout/components/ProfilePreview.vue +++ b/src/layout/components/ProfilePreview.vue @@ -42,6 +42,7 @@ import { config } from '@/utils/ADempiere/config' // Utils and Helper Methods // import { getImagePath } from '@/utils/ADempiere/resource.js' import { requestListResources } from '@/api/ADempiere/file-management/resource-reference.ts' +import { isEmptyValue } from '@/utils/ADempiere' export default defineComponent({ name: 'ProfilePreview', @@ -117,6 +118,11 @@ export default defineComponent({ tableName: 'AD_User' }) .then(response => { + const { resources } = response + if (isEmptyValue(resources)) { + avatarResize.value = require('@/image/ADempiere/avatar/no-avatar.png') + return + } const image = response.resources[0].name avatarResize.value = config.adempiere.resource.url + image return config.adempiere.resource.url + image