Skip to content

Commit

Permalink
feat(manageprofileshow.vue): add identicon
Browse files Browse the repository at this point in the history
  • Loading branch information
supersonictw committed Nov 1, 2024
1 parent bc1066e commit f361063
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions src/components/ManageProfileShow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,20 @@
<div class="px-6 py-4 bg-white border-b border-gray-200 font-bold">
您好,{{ myProfile.nickname }},這裡是您的個人資料:
</div>
<div class="p-6 bg-white border-b border-gray-200">
<span class="text-gray-600">暱稱:</span>{{ myProfile.nickname }}<br>
<span class="text-gray-600">電子郵件地址:</span>{{ myProfile.email }}<br>
<span class="text-gray-600">Sara 系統使用者識別碼:</span>{{ myProfile._id }}
<div class="px-6 py-4 bg-white border-b border-gray-200 md:flex">
<div class="item-center px-3 mb-3 md:mb-0">
<img
:src="identicon"
:alt="myProfile.nickname"
class="rounded-full w-18 h-18 mx-auto"
title="來自 Gravatar 的大頭貼"
>
</div>
<div class="ml-3">
<span class="text-gray-600">暱稱:</span>{{ myProfile.nickname }}<br>
<span class="text-gray-600">電子郵件地址:</span>{{ myProfile.email }}<br>
<span class="text-gray-600">Sara 系統使用者識別碼:</span>{{ myProfile._id }}
</div>
</div>
<div class="p-6 bg-white border-b border-gray-200 text-right">
<button
Expand Down Expand Up @@ -119,6 +129,11 @@ const isShowPasskeyAdd = computed(() => {
return browserSupportsWebAuthn();
});
const identicon = computed(() => {
const {avatar_hash: avatarHash} = myProfile;
return `https://api.gravatar.com/avatar/${avatarHash}?d=identicon`;
});
const onClickLogout = () => {
localStorage.removeItem(saraTokenName);
localStorage.removeItem(saraGuardName);
Expand Down

0 comments on commit f361063

Please sign in to comment.