登录页加载态、日志动作补齐与绑定按钮禁用态
CI / test (push) Successful in 27s
Release / release (push) Successful in 28s

This commit is contained in:
2026-07-14 11:01:09 +08:00
parent e2cdb99194
commit 08fa529348
4 changed files with 53 additions and 2 deletions
+11
View File
@@ -2,6 +2,17 @@
格式参考 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/)(版本段不记日期),版本号遵循语义化版本。
## [0.5.1]
### Changed
- 设置 · 账号安全绑定入口:已绑定的登录方式按钮置禁用态并显示「已绑定」,解绑后自动恢复可点
### Fixed
- 修复禁用密码登录后登录页闪烁:登录方式加载完成前显示加载态,不再先渲染密码表单再切换,同时消除了闪烁窗口内误提交密码触发 403「密码登录已禁用」日志的问题
- 系统日志「动作」列补齐 26 条缺失描述(退出登录、外部身份登录 / 绑定、修改登录凭据、AI 密钥 / 渠道 / 黑名单 / 网关设置、通知渠道 / 模板、代理导入 / 探测 / 关联租户等)
## [0.5.0]
### Added
@@ -204,6 +204,11 @@ const bindableProviders = computed(() => {
return out
})
/** 已绑定的 provider 集合;绑定入口按钮据此禁用,解绑后自动恢复 */
const boundProviders = computed(
() => new Set((identities.data.value?.items ?? []).map((it) => it.provider)),
)
async function bindProvider(provider: string) {
binding.value = provider
try {
@@ -507,9 +512,10 @@ async function deleteProvider(p: ProviderType) {
:key="p"
size="small"
:loading="binding === p"
:disabled="boundProviders.has(p)"
@click="bindProvider(p)"
>
绑定 {{ displayNameOf(p) }}
{{ boundProviders.has(p) ? '已绑定' : '绑定' }} {{ displayNameOf(p) }}
</NButton>
<span class="text-xs text-ink-3">将跳转到对应平台授权</span>
</div>
+24
View File
@@ -4,6 +4,11 @@
*/
const exact: Record<string, string> = {
'POST /api/v1/auth/login': '登录面板',
'POST /api/v1/auth/logout': '退出登录',
'GET /api/v1/auth/oauth/:provider/callback': '外部身份登录 / 绑定',
'PUT /api/v1/auth/credentials': '修改登录凭据',
'PUT /api/v1/auth/password-login': '切换密码登录开关',
'POST /api/v1/auth/revoke-sessions': '撤销全部会话',
'POST /api/v1/auth/totp/setup': '发起两步验证绑定',
'POST /api/v1/auth/totp/activate': '启用两步验证',
'POST /api/v1/auth/totp/disable': '停用两步验证',
@@ -42,6 +47,25 @@ const exact: Record<string, string> = {
'DELETE /api/v1/tasks/:id': '删除后台任务',
'POST /api/v1/tasks/:id/run': '手动执行任务',
'POST /api/v1/webhooks/oci-logs/:secret': '回传消息投递',
'POST /api/v1/ai-keys': '创建网关密钥',
'PUT /api/v1/ai-keys/:id': '修改网关密钥',
'DELETE /api/v1/ai-keys/:id': '删除网关密钥',
'PUT /api/v1/ai-keys/:id/content-log': '设置密钥内容留痕',
'POST /api/v1/ai-channels': '创建网关渠道',
'PUT /api/v1/ai-channels/:id': '修改网关渠道',
'DELETE /api/v1/ai-channels/:id': '删除网关渠道',
'POST /api/v1/ai-channels/:id/probe': '探测网关渠道',
'POST /api/v1/ai-channels/:id/sync-models': '同步渠道模型',
'POST /api/v1/ai-blacklist': '拉黑模型',
'DELETE /api/v1/ai-blacklist/:id': '移出模型黑名单',
'PUT /api/v1/ai-settings': '保存网关设置',
'PUT /api/v1/settings/notify-channels/:type': '保存通知渠道配置',
'POST /api/v1/settings/notify-channels/:type/test': '发送通知测试消息',
'PUT /api/v1/settings/notify-templates/:kind': '保存通知模板',
'POST /api/v1/settings/notify-templates/:kind/test': '发送模板测试消息',
'POST /api/v1/proxies/import': '批量导入代理',
'POST /api/v1/proxies/:id/probe': '探测代理',
'PUT /api/v1/proxies/:id/tenants': '设置代理关联租户',
}
/** 资源段兜底词典:精确表未命中时以「动词 + 资源」组合 */
+11 -1
View File
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { NButton, NInput } from 'naive-ui'
import { NButton, NInput, NSpin } from 'naive-ui'
import { onMounted, ref } from 'vue'
import { useRoute, useRouter } from 'vue-router'
@@ -30,6 +30,8 @@ const errorMsg = ref('')
const providers = ref<OauthProviderInfo[]>([])
// 密码登录已禁用(设置里开启且存在可用外部身份):隐藏用户名密码表单
const passwordLoginDisabled = ref(false)
// 登录方式加载中:providers 返回前不渲染表单,避免「先见密码表单再消失」的闪烁与误提交
const bootLoading = ref(true)
// 左侧品牌区功能徽章:各自不同周期/幅度/相位上下浮动(不规律观感)
const featureChips = [
@@ -47,6 +49,8 @@ onMounted(async () => {
passwordLoginDisabled.value = r.passwordLoginDisabled && r.providers.length > 0
} catch {
/* 登录页容忍 provider 列表加载失败 */
} finally {
bootLoading.value = false
}
})
@@ -155,6 +159,11 @@ async function oauthLogin(provider: string) {
<div class="rounded-[14px] border border-line bg-card px-[30px] pt-[30px] pb-7 shadow-[0_18px_50px_rgba(20,20,19,.10),0_2px_8px_rgba(20,20,19,.05)]">
<div class="font-serif text-[19px] font-semibold">欢迎回来</div>
<div v-if="bootLoading" class="flex items-center justify-center py-14">
<NSpin size="small" />
</div>
<template v-else>
<div
v-if="errorMsg"
class="mt-4 flex items-start gap-2 rounded-md border border-err/30 bg-err/10 px-3 py-2 text-[12.5px] text-err"
@@ -227,6 +236,7 @@ async function oauthLogin(provider: string) {
由管理员在 设置 · 账号安全 中管理
</div>
</template>
</template>
</div>
</div>
</div>