二维码
This commit is contained in:
@ -911,16 +911,16 @@ public class MemberUserServiceImpl implements MemberUserService {
|
|||||||
@Override
|
@Override
|
||||||
public String getQRCode() {
|
public String getQRCode() {
|
||||||
Long userId = getLoginUserId();
|
Long userId = getLoginUserId();
|
||||||
String redisKey = QRCodeWithJWTUtil.QR_PREFIX+userId;
|
// String redisKey = QRCodeWithJWTUtil.QR_PREFIX+userId;
|
||||||
String url = memberUserRedisTemplate.opsForValue().get(redisKey);
|
// String url = memberUserRedisTemplate.opsForValue().get(redisKey);
|
||||||
if(StrUtil.isNotEmpty(url)){
|
// if(StrUtil.isNotEmpty(url)){
|
||||||
return url;
|
// return url;
|
||||||
}
|
// }
|
||||||
String encode = DigestUtil.md5Hex(userId.toString()+System.currentTimeMillis());
|
String encode = DigestUtil.md5Hex(userId.toString()+System.currentTimeMillis());
|
||||||
String fileName = "QRCode_" + userId + ".png";
|
String fileName = "QRCode_" + userId + ".png";
|
||||||
String path = QRCodeWithJWTUtil.BASE_PATH+fileName;
|
String path = QRCodeWithJWTUtil.BASE_PATH+fileName;
|
||||||
QRCodeWithJWTUtil.generateQRCode(encode, 350, 350, path); // 生
|
QRCodeWithJWTUtil.generateQRCode(encode, 350, 350, path); // 生
|
||||||
memberUserRedisTemplate.opsForValue().set(redisKey,path,180, TimeUnit.SECONDS);
|
// memberUserRedisTemplate.opsForValue().set(redisKey,path,180, TimeUnit.SECONDS);
|
||||||
memberUserRedisTemplate.opsForValue().set(encode,userId.toString(),180, TimeUnit.SECONDS);
|
memberUserRedisTemplate.opsForValue().set(encode,userId.toString(),180, TimeUnit.SECONDS);
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user