修复算数验证码生成BUG
This commit is contained in:
+5
-1
@@ -145,7 +145,11 @@ public class SysLoginServiceImpl implements SysLoginService {
|
|||||||
redisService.set(cacheParam.key(uid), arithmeticDto.getResult(), cacheParam.expireTime());
|
redisService.set(cacheParam.key(uid), arithmeticDto.getResult(), cacheParam.expireTime());
|
||||||
|
|
||||||
// 转换为base64的验证码
|
// 转换为base64的验证码
|
||||||
return "data:image/png;base64," + new String(Base64Utils.encode(imgCode) == null ? new byte[0] : imgCode);
|
byte[] encode = Base64Utils.encode(imgCode);
|
||||||
|
if (BytesUtils.isEmpty(encode)) {
|
||||||
|
throw new BizError("验证码生成失败");
|
||||||
|
}
|
||||||
|
return "data:image/png;base64," + new String(encode);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user