登录页加载态、日志动作补齐与绑定按钮禁用态
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 -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>