5a7ad8de11
- OSS 文件存储(RustFS / S3 v4 兼容,零依赖手写 SigV4): 上传/列表/删除走桶 arcticnewone,/uploads 代理服务 + 本地回退; server/utils/sigv4.ts 纯函数 + AWS 测试向量验证 - 业务动态配置:settings 表 + /api/settings(公开) + /api/admin/settings(PATCH), useSiteSettings 组合式,footer/contact/tools/app.vue/侧边栏/工具页全部接入, 后台 /admin/settings 修改前台即时生效(站点/联系/社交/工具箱/页脚/SEO) - 后台全面优化:Admin* 设计系统(按钮/输入/表单/卡片/徽标/弹窗/确认/空态/骨架/ 分页/页头/Toast)14 组件;Dashboard 增强;各列表页搜索/筛选/批量删除/分页; 布局与侧边栏分组;统一 toast/确认反馈 - 个人中心全新重设计:顶部资料卡 + 统计、精致化改密/删号(二次确认)、 收藏封面网格、评论卡片、移动端适配 - deploy.sh 支持 OSS 凭据注入(NUXT_OSS_*);.env.example 更新 - 测试 17 例全过(含 SigV4 AWS 向量、settings 默认结构)
55 lines
1.6 KiB
Vue
55 lines
1.6 KiB
Vue
<template>
|
|
<Teleport to="body">
|
|
<div class="fixed top-4 right-4 z-[200] flex flex-col gap-2 w-80 max-w-[calc(100vw-2rem)]">
|
|
<TransitionGroup name="toast">
|
|
<div
|
|
v-for="t in toast.toasts"
|
|
:key="t.id"
|
|
class="flex items-start gap-3 rounded-xl border bg-white px-4 py-3 shadow-lg"
|
|
:class="borderClass(t.type)"
|
|
>
|
|
<Icon :name="iconFor(t.type)" class="w-5 h-5 mt-0.5" :class="iconClass(t.type)" />
|
|
<p class="flex-1 text-sm text-gray-800 break-words">{{ t.message }}</p>
|
|
<button @click="toast.remove(t.id)" class="text-gray-400 hover:text-gray-600" aria-label="close">
|
|
<Icon name="ph:x" class="w-4 h-4" />
|
|
</button>
|
|
</div>
|
|
</TransitionGroup>
|
|
</div>
|
|
</Teleport>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { useToastStore } from '~/stores/toast'
|
|
|
|
const toast = useToastStore()
|
|
|
|
const borderClass = (type: string) => {
|
|
if (type === 'success') return 'border-green-200'
|
|
if (type === 'error') return 'border-red-200'
|
|
return 'border-gray-200'
|
|
}
|
|
const iconFor = (type: string) => {
|
|
if (type === 'success') return 'ph:check-circle-fill'
|
|
if (type === 'error') return 'ph:warning-circle-fill'
|
|
return 'ph:info-fill'
|
|
}
|
|
const iconClass = (type: string) => {
|
|
if (type === 'success') return 'text-green-600'
|
|
if (type === 'error') return 'text-red-600'
|
|
return 'text-gray-400'
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
.toast-enter-active,
|
|
.toast-leave-active {
|
|
transition: all 0.25s ease;
|
|
}
|
|
.toast-enter-from,
|
|
.toast-leave-to {
|
|
opacity: 0;
|
|
transform: translateX(16px);
|
|
}
|
|
</style>
|