改成 crypto.randomUUID(); 生成uuid

This commit is contained in:
于小丘
2025-10-13 09:35:39 +08:00
parent 374f2a92aa
commit 432a5d01f8
3 changed files with 5 additions and 8 deletions
@@ -11,7 +11,6 @@
<script lang="ts" setup>
import { computed, onMounted, ref } from 'vue';
import { register, sendSmsCode } from '@/api/auth';
import { v4 as uuidv4 } from 'uuid';
import { useConfigStore } from '@/store';
import { getEnvBaseUrl } from '@/utils';
import { toast } from '@/utils/toast';
@@ -127,7 +126,7 @@ function closeAreaCodeSheet() {
// 获取验证码
async function refreshCaptcha() {
const uuid = uuidv4();
const uuid = crypto.randomUUID();
formData.value.captchaId = uuid;
captchaImage.value = `${getEnvBaseUrl()}/user/captcha?uuid=${uuid}&t=${Date.now()}`;
}