mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-22 07:03:53 +08:00
改成 crypto.randomUUID(); 生成uuid
This commit is contained in:
@@ -11,7 +11,6 @@
|
||||
<script lang="ts" setup>
|
||||
import { computed, onMounted, ref } from "vue";
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
import { useConfigStore } from "@/store";
|
||||
import { getEnvBaseUrl, sm2Encrypt } from "@/utils";
|
||||
import { toast } from "@/utils/toast";
|
||||
@@ -117,7 +116,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()}`;
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
<script lang="ts" setup>
|
||||
import type { LoginData } from '@/api/auth';
|
||||
import { computed, onMounted, ref } from 'vue';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
import { login } from '@/api/auth';
|
||||
import { useConfigStore } from '@/store';
|
||||
import { getEnvBaseUrl } from '@/utils';
|
||||
@@ -135,9 +134,9 @@ function goToServerSetting() {
|
||||
|
||||
// 获取验证码
|
||||
async function refreshCaptcha() {
|
||||
const uuid = uuidv4();
|
||||
formData.value.captchaId = uuid
|
||||
captchaImage.value = `${getEnvBaseUrl()}/user/captcha?uuid=${uuid}&t=${Date.now()}`
|
||||
const uuid = crypto.randomUUID();
|
||||
formData.value.captchaId = uuid;
|
||||
captchaImage.value = `${getEnvBaseUrl()}/user/captcha?uuid=${uuid}&t=${Date.now()}`;
|
||||
}
|
||||
|
||||
// 登录
|
||||
|
||||
@@ -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()}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user