讲书下添加点赞评论
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
package com.peanut.common.utils;
|
||||
|
||||
import com.peanut.common.exception.RRException;
|
||||
import com.peanut.modules.book.entity.MyUserEntity;
|
||||
import com.peanut.modules.sys.entity.SysUserEntity;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.apache.shiro.session.Session;
|
||||
@@ -36,6 +37,11 @@ public class ShiroUtils {
|
||||
public static Long getUserId() {
|
||||
return getUserEntity().getUserId();
|
||||
}
|
||||
|
||||
public static Integer getUId() {
|
||||
MyUserEntity user = (MyUserEntity)SecurityUtils.getSubject().getPrincipal();
|
||||
return user.getId();
|
||||
}
|
||||
|
||||
public static void setSessionAttribute(Object key, Object value) {
|
||||
getSession().setAttribute(key, value);
|
||||
|
||||
Reference in New Issue
Block a user