Merge pull request #2641 from qingshuiyuyu/bugfix

修复注册设备接口,验证码死循环BUG
This commit is contained in:
hrz
2025-12-04 18:54:33 +08:00
committed by GitHub
@@ -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));