mirror of
https://github.com/RemainderTime/spring-boot-base-demo.git
synced 2026-02-18 21:10:55 +08:00
1.引入sa-token权限框架
2.实现RBAC模型相关表结构(用户-权限-菜单-角色)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package cn.xf.basedemo.service.impl;
|
||||
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import cn.xf.basedemo.common.model.EsBaseModel;
|
||||
import cn.xf.basedemo.common.model.LoginInfo;
|
||||
import cn.xf.basedemo.common.model.LoginUser;
|
||||
@@ -90,7 +91,8 @@ public class UserServiceImpl implements UserService {
|
||||
|
||||
redisTemplate.opsForValue().set("token:" + token, JSONObject.toJSONString(loginUser), 3600, TimeUnit.SECONDS);
|
||||
redisTemplate.opsForValue().set("user_login_token:" + user.getId(), token, 3600, TimeUnit.SECONDS);
|
||||
|
||||
//登录成功 写入sa-token中
|
||||
StpUtil.login(user.getId());
|
||||
return RetObj.success(loginUser);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user