optimize+注释

This commit is contained in:
stardrophere
2026-03-13 23:48:49 +08:00
parent 6aee65af6c
commit da00ebb8f2
41 changed files with 874 additions and 174 deletions
+2 -3
View File
@@ -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)