mirror of
https://github.com/stardrophere/InsightRadar.git
synced 2026-06-06 03:07:50 +08:00
optimize+注释
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
<!-- 注册页:邮箱验证码 + 密码,带密码强度提示 -->
|
||||
<script setup lang="ts">
|
||||
import { computed, onUnmounted, reactive, ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
@@ -34,7 +35,7 @@ const canSendCode = computed(() => {
|
||||
return /^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(form.email)
|
||||
})
|
||||
|
||||
// === 新增:密码强度计算逻辑 ===
|
||||
// 密码强度:根据长度、字母、数字、特殊字符计算 0~4 档
|
||||
const passwordStrength = computed(() => {
|
||||
const pwd = form.password
|
||||
if (!pwd) return 0
|
||||
@@ -52,8 +53,6 @@ const strengthColor = computed(() => {
|
||||
return colors[passwordStrength.value]
|
||||
})
|
||||
|
||||
// ==========================
|
||||
|
||||
function startCooldown(seconds = CODE_RESEND_SECONDS) {
|
||||
countdown.value = Math.max(1, seconds)
|
||||
if (countdownTimer) clearInterval(countdownTimer)
|
||||
|
||||
Reference in New Issue
Block a user