请问老师你的注册操作为什么注册完成后认证完邮箱后又把用户删了,详情看代码
来源:4-8 登录流程-后端代码实现
慕UI5248983
2018-08-01
private final Cache<String, String> registerCache = CacheBuilder.newBuilder().maximumSize(100)
.expireAfterAccess(15, TimeUnit.MINUTES)
.removalListener(new RemovalListener<String, String>() {
@Override
public void onRemoval(RemovalNotification<String, String> notification) {
// TODO Auto-generated method stub
userMapper.delete(notification.getValue());
}
}).build();
如题,我观察到邮箱验证完成后又把用户删了,目的是啥
写回答
1回答
-
registerCache.invalidate(key);这段代码会触发 guaua cache的onRemoval的回调方法,激活更新用户依然会被删除掉。要加判断 if (removalNotification.getCause() == RemovalCause.EXPIRED){userMapper.delete(notification.getValue());}
122019-01-29
相似问题