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