mirror of
https://github.com/fawney19/Aether.git
synced 2026-01-02 15:52:26 +08:00
- 重构: 将 verification 模块重命名为 email,目录结构更清晰 - 新增: 独立的邮件配置管理页面 (EmailSettings.vue) - 新增: 邮件模板管理功能(支持自定义 HTML 模板和预览) - 新增: 查询验证状态 API,支持页面刷新后恢复验证流程 - 新增: 注册邮箱后缀白名单/黑名单限制功能 - 修复: 统一密码最小长度为 6 位(前后端一致) - 修复: SMTP 连接添加 30 秒超时配置,防止 worker 挂起 - 修复: 邮件模板变量添加 HTML 转义,防止 XSS - 修复: 验证状态清除改为 db.commit 后执行,避免竞态条件 - 优化: RegisterDialog 重写验证码输入组件,提升用户体验 - 优化: Input 组件支持 disableAutofill 属性
49 lines
1.3 KiB
Vue
49 lines
1.3 KiB
Vue
<template>
|
|
<input
|
|
:class="inputClass"
|
|
:value="modelValue"
|
|
:autocomplete="autocompleteAttr"
|
|
:data-lpignore="disableAutofill ? 'true' : undefined"
|
|
:data-1p-ignore="disableAutofill ? 'true' : undefined"
|
|
:data-form-type="disableAutofill ? 'other' : undefined"
|
|
v-bind="$attrs"
|
|
@input="handleInput"
|
|
>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { computed } from 'vue'
|
|
import { cn } from '@/lib/utils'
|
|
|
|
interface Props {
|
|
modelValue?: string | number
|
|
class?: string
|
|
autocomplete?: string
|
|
disableAutofill?: boolean
|
|
}
|
|
|
|
const props = defineProps<Props>()
|
|
const emit = defineEmits<{
|
|
'update:modelValue': [value: string]
|
|
}>()
|
|
|
|
const autocompleteAttr = computed(() => {
|
|
if (props.disableAutofill) {
|
|
return 'one-time-code'
|
|
}
|
|
return props.autocomplete ?? 'off'
|
|
})
|
|
|
|
const inputClass = computed(() =>
|
|
cn(
|
|
'flex h-11 w-full rounded-2xl border border-border/60 bg-card/80 px-4 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:border-primary/60 text-foreground backdrop-blur transition-all',
|
|
props.class
|
|
)
|
|
)
|
|
|
|
function handleInput(event: Event) {
|
|
const target = event.target as HTMLInputElement
|
|
emit('update:modelValue', target.value)
|
|
}
|
|
</script>
|