mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-22 07:03:53 +08:00
修复注册设备接口,验证码死循环BUG
This commit is contained in:
+4
-2
@@ -72,10 +72,12 @@ public class DeviceController {
|
||||
return new Result<String>().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));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user