Commit a68ed777 authored by 李德才's avatar 李德才

退出系统清空Redis 中的用户信息缓存

parent 67328186
......@@ -253,7 +253,7 @@ public class IndexController extends Controller {
// 设置过期时间
Redis.use().expire(username, 60 * 60 * 24);
/**
* 20200706 lidecai 将用户信息保存到Redis end
* 20200706 lidecai 将用户信息保存到Redis end
*/
this.renderJson(Ret.ok("token", jws).set("callback", callback));
logService.saveAsLog("login", username, JwtInterceptor.getIpAddr(getRequest()),
......@@ -450,6 +450,19 @@ public class IndexController extends Controller {
this.renderJson(Ret.fail("msg", "生成登录票据失败"));
logService.saveAsLog("login", userName, JwtInterceptor.getIpAddr(getRequest()), "生成登录票据失败", app);
}
}
/**
* 退出系统,清空Redis 中的用户信息
* @Time:2020年7月6日 - 下午5:19:58
* @author:李德才
* @param:
* @return: void
* @throws
*/
public void loginOut() {
String userName = getAttrForStr("username");
Redis.use().del(userName + "_INFO");
renderJson(Ret.ok());
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment