package com.lyq.action.interceptor; import java.util.Map; import com.lyq.action.BaseAction; import com.opensymphony.xwork2.ActionContext; import com.opensymphony.xwork2.ActionInvocation; import com.opensymphony.xwork2.interceptor.AbstractInterceptor; /** * 管理员登录拦截器 * @author Li Yongqiang */ public class UserLoginInterceptor extends AbstractInterceptor { private static final long serialVersionUID = 1L; @Override public String intercept(ActionInvocation invocation) throws Exception { // 获取ActionContext ActionContext context = invocation.getInvocationContext(); // 获取Map类型的session Map<String, Object> session = context.getSession(); // 判断用户是否登录 if(session.get("admin") != null){ // 调用执行方法 return invocation.invoke(); } // 返回登录 return BaseAction.USER_LOGIN; } }
最近下载更多
hongdongdong LV12
2023年12月16日
微信网友_6680567232876544 LV8
2023年10月10日
2036495585 LV9
2023年9月25日
pangxiangdong LV4
2023年3月12日
xiaowangjj LV4
2023年2月15日
微信网友_5966087716769792 LV9
2022年9月2日
309681 LV5
2022年5月11日
kuoluoluo LV3
2022年4月18日
149872g LV2
2022年3月28日
不停的奔跑 LV20
2022年3月5日
最近浏览更多
zrz666 LV1
4月18日
刘孟飞 LV19
3月29日
heshao LV2
1月11日
a2418735612 LV1
1月4日
1765281247
1月2日
暂无贡献等级
微信网友_6797846869299200 LV7
1月1日
asddwh LV12
2023年12月26日
1601547803 LV1
2023年12月26日
2517958616 LV1
2023年12月26日
qxs110 LV1
2023年12月25日