审查视图

src/main/java/tools/Tools.java 492 字节
fujinghui authored
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
package tools;

import org.apache.shiro.SecurityUtils;

import com.agent.entity.system.UserEntity;

public class Tools {
	public static Long getUserId(){
		UserEntity ue = (UserEntity)SecurityUtils.getSubject().getSession().getAttribute("user");
		Long user_id = null;
		if(ue != null){
			user_id = ue.getId();
		}
		return user_id;
	}
16 17 18 19 20
	
	public static UserEntity getUserEntity(){
		UserEntity ue = (UserEntity)SecurityUtils.getSubject().getSession().getAttribute("user");
		return ue;
	}
fujinghui authored
21
}