feat: 添加剪贴板功能,更新用户信息展示,优化用户设置界面

This commit is contained in:
2025-12-21 05:00:00 +07:00
parent 7dfc125f66
commit c76933a62a
8 changed files with 60 additions and 15 deletions

View File

@@ -1,5 +1,5 @@
<script lang='ts' setup>
import { alertController } from "@ionic/vue";
import { alertController, toastController } from "@ionic/vue";
import { arrowBackOutline } from "ionicons/icons";
import TdesignCopy from "~icons/tdesign/copy";
import { authClient } from "@/auth";
@@ -31,6 +31,21 @@ async function handleSignOut() {
await alert.present();
}
const { writeText } = useClipboard();
function handleCopyUid() {
if (userProfile.value?.uid) {
writeText(userProfile.value.uid);
toastController
.create({
message: "UID copied to clipboard",
duration: 2000,
position: "bottom",
})
.then(toast => toast.present());
}
}
</script>
<template>
@@ -62,8 +77,8 @@ async function handleSignOut() {
UID
</div>
</div>
<div class="end">
<div>54213213</div>
<div class="end" @click="handleCopyUid">
<div>{{ userProfile?.uid }}</div>
<TdesignCopy />
</div>
</div>