From f3580119000bf71a9e8c49409ebe0ef6e54044b3 Mon Sep 17 00:00:00 2001 From: shiyin Date: Thu, 4 Dec 2025 18:32:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B3=A8=E5=86=8C=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E6=8E=A5=E5=8F=A3,=E9=AA=8C=E8=AF=81=E7=A0=81?= =?UTF-8?q?=E6=AD=BB=E5=BE=AA=E7=8E=AFBUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xiaozhi/modules/device/controller/DeviceController.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main/manager-api/src/main/java/xiaozhi/modules/device/controller/DeviceController.java b/main/manager-api/src/main/java/xiaozhi/modules/device/controller/DeviceController.java index ff6069bf..78a17b02 100644 --- a/main/manager-api/src/main/java/xiaozhi/modules/device/controller/DeviceController.java +++ b/main/manager-api/src/main/java/xiaozhi/modules/device/controller/DeviceController.java @@ -72,10 +72,12 @@ public class DeviceController { return new Result().error(ErrorCode.MCA_NOT_NULL); } // 生成六位验证码 - String code = String.valueOf(Math.random()).substring(2, 8); - String key = RedisKeys.getDeviceCaptchaKey(code); + String code; + String key; String existsMac = null; do { + code = String.valueOf(Math.random()).substring(2, 8); + key = RedisKeys.getDeviceCaptchaKey(code); existsMac = (String) redisUtils.get(key); } while (StringUtils.isNotBlank(existsMac));