- 新增 /api/admin/songs/batch-reject.post 批量驳回接口(事务清排期/投票/扣接纳数/黑名单去重/异步通知) - requireSongAdmin 三角色校验 + createApiError 统一错误包装 - scheduleDaysBefore/After 四字段排期可见范围限制(开放 API 与公开排期接口三处缓存路径 + DB 条件过滤) - submissionNoteAutoModeration 基于黑名单 KEYWORD/LANGUAGE/GENRE 自动判定留言 publicStatus,命中自动关闭 submissionNotePublic - 更新 songs/request.post 与 songs/[id]/update.put 接入自动审查逻辑
55 lines
2.9 KiB
Vue
55 lines
2.9 KiB
Vue
<template>
|
|
<div v-if="hasEnabledProviders" class="mt-6 w-full">
|
|
<div class="flex items-center text-center text-[var(--text-tertiary)] text-xs mb-4">
|
|
<div class="flex-1 border-b border-[var(--border-color)] opacity-20" />
|
|
<span class="px-2.5">或使用第三方账号登录</span>
|
|
<div class="flex-1 border-b border-[var(--border-color)] opacity-20" />
|
|
</div>
|
|
<div class="flex justify-center gap-4">
|
|
<button
|
|
v-if="config.public.oauth.github"
|
|
type="button"
|
|
class="w-12 h-12 rounded-full border border-[var(--border-color)] bg-[var(--bg-secondary)] text-[var(--text-primary)] flex items-center justify-center cursor-pointer transition-all duration-200 hover:-translate-y-0.5 hover:shadow-sm hover:bg-[var(--bg-tertiary)] hover:bg-[#24292e] hover:text-white hover:border-[#24292e]"
|
|
title="使用 GitHub 登录"
|
|
@click="loginWith('github')"
|
|
>
|
|
<AuthProvidersGitHubIcon />
|
|
</button>
|
|
|
|
<button
|
|
v-if="config.public.oauth.google"
|
|
type="button"
|
|
class="w-12 h-12 rounded-full border border-[var(--border-color)] bg-[var(--bg-secondary)] text-[var(--text-primary)] flex items-center justify-center cursor-pointer transition-all duration-200 hover:-translate-y-0.5 hover:shadow-sm hover:bg-[var(--bg-tertiary)] hover:bg-white hover:text-black hover:border-[#dadce0]"
|
|
title="使用 Google 登录"
|
|
@click="loginWith('google')"
|
|
>
|
|
<AuthProvidersGoogleIcon />
|
|
</button>
|
|
|
|
<button
|
|
v-if="config.public.oauth.aggregate"
|
|
type="button"
|
|
class="w-12 h-12 rounded-full border border-[var(--border-color)] bg-[var(--bg-secondary)] text-[var(--text-primary)] flex items-center justify-center cursor-pointer transition-all duration-200 hover:-translate-y-0.5 hover:shadow-sm hover:bg-[var(--bg-tertiary)] hover:bg-[#12B7F5] hover:text-white hover:border-[#12B7F5]"
|
|
title="使用 QQ / 微信登录"
|
|
@click="loginWith('aggregate')"
|
|
>
|
|
<svg viewBox="0 0 24 24" width="22" height="22" fill="currentColor" aria-hidden="true">
|
|
<path d="M8.5 4C4.9 4 2 6.8 2 10.3c0 2 1.1 3.7 2.8 4.9L4 18l3-1.5c.5.1 1 .2 1.5.2h.6c-.1-.4-.1-.8 0-1.2H8.5C5.5 15.5 3 13.2 3 10.3 3 7.4 5.5 5 8.5 5h1.6c.3-1.1 1.3-1.9 2.5-1.9.5 0 1 .2 1.4.5C13.3 3 10.7 4 8.5 4zM10.1 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm8.4 1.2c-2.5 0-4.5 2-4.5 4.5s2 4.5 4.5 4.5c.6 0 1.2-.1 1.7-.3L22 17.5l-.8-2.3c1.4-1 2.3-2.6 2.3-4.3C23.5 9.2 21.5 7.2 19 7.2c-.5 0-1 0-1.4.1C16.9 7.8 17.9 7.2 19 7.2zM17 9.7c-.8 0-1.5.7-1.5 1.5s.7 1.5 1.5 1.5 1.5-.7 1.5-1.5-.7-1.5-1.5-1.5z"/>
|
|
</svg>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
const config = useRuntimeConfig()
|
|
|
|
const hasEnabledProviders = computed(() => {
|
|
return config.public.oauth && Object.values(config.public.oauth).some((enabled) => enabled)
|
|
})
|
|
|
|
const loginWith = (provider: string) => {
|
|
navigateTo(`/api/auth/${provider}`, { external: true })
|
|
}
|
|
</script>
|