diff --git a/src/components/UserPanel.vue b/src/components/UserPanel.vue index 691d3db8f..9c3b456b1 100644 --- a/src/components/UserPanel.vue +++ b/src/components/UserPanel.vue @@ -11,6 +11,7 @@ import VnSelect from 'src/components/common/VnSelect.vue'; import VnRow from 'components/ui/VnRow.vue'; import FetchData from 'components/FetchData.vue'; import { useClipboard } from 'src/composables/useClipboard'; +import VnImg from 'src/components/ui/VnImg.vue'; const state = useState(); const session = useSession(); @@ -47,7 +48,6 @@ const darkMode = computed({ }); const user = state.getUser(); -const token = session.getTokenMultimedia(); const warehousesData = ref(); const companiesData = ref(); const accountBankData = ref(); @@ -149,10 +149,7 @@ function saveUserData(param, value) {
- +
diff --git a/src/components/ui/VnImg.vue b/src/components/ui/VnImg.vue index 37072a69e..3996e9ddc 100644 --- a/src/components/ui/VnImg.vue +++ b/src/components/ui/VnImg.vue @@ -3,10 +3,14 @@ import { ref, computed, onMounted } from 'vue'; import { useSession } from 'src/composables/useSession'; const $props = defineProps({ - collection: { + storage: { type: [String, Number], default: 'Images', }, + collection: { + type: String, + default: 'catalog', + }, size: { type: String, default: '200x200', @@ -26,9 +30,8 @@ const token = useSession().getTokenMultimedia(); const timeStamp = ref(`timestamp=${Date.now()}`); const url = computed( () => - `/api/${$props.collection}/catalog/${$props.size}/${$props.id}/download?access_token=${token}&${timeStamp.value}` + `/api/${$props.storage}/${$props.collection}/${$props.size}/${$props.id}/download?access_token=${token}&${timeStamp.value}` ); -const emits = defineEmits(['refresh']); const reload = (emit = false) => { timeStamp.value = `timestamp=${Date.now()}`; }; diff --git a/src/pages/Account/Card/AccountDescriptor.vue b/src/pages/Account/Card/AccountDescriptor.vue index 2ff8afa33..ddc7c077f 100644 --- a/src/pages/Account/Card/AccountDescriptor.vue +++ b/src/pages/Account/Card/AccountDescriptor.vue @@ -6,8 +6,8 @@ import CardDescriptor from 'components/ui/CardDescriptor.vue'; import VnLv from 'src/components/ui/VnLv.vue'; import useCardDescription from 'src/composables/useCardDescription'; import AccountDescriptorMenu from './AccountDescriptorMenu.vue'; -import { useSession } from 'src/composables/useSession'; import FetchData from 'src/components/FetchData.vue'; +import VnImg from 'src/components/ui/VnImg.vue'; const $props = defineProps({ id: { @@ -19,7 +19,6 @@ const $props = defineProps({ const route = useRoute(); const { t } = useI18n(); -const { getTokenMultimedia } = useSession(); const entityId = computed(() => { return $props.id || route.params.id; }); @@ -31,10 +30,6 @@ const filter = { fields: ['id', 'nickname', 'name', 'role'], include: { relation: 'role', scope: { fields: ['id', 'name'] } }, }; -function getAccountAvatar() { - const token = getTokenMultimedia(); - return `/api/Images/user/160x160/${entityId.value}/download?access_token=${token}`; -} const hasAccount = ref(false); @@ -72,7 +67,8 @@ const hasAccount = ref(false);