|
|
@@ -10,6 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
|
import com.goafanti.common.bo.Error;
|
|
|
import com.goafanti.common.bo.Result;
|
|
|
+import com.goafanti.common.dao.AdminMapper;
|
|
|
import com.goafanti.common.model.Admin;
|
|
|
import com.goafanti.common.model.AftUser;
|
|
|
import com.goafanti.common.utils.LoggerUtils;
|
|
|
@@ -20,6 +21,8 @@ public class AdminFilter extends AccessControlFilter {
|
|
|
|
|
|
@Autowired
|
|
|
private ShiroFilterUtils shiroFilterUtils;
|
|
|
+ @Autowired
|
|
|
+ private AdminMapper adminMapper;
|
|
|
|
|
|
@Override
|
|
|
protected boolean isAccessAllowed(ServletRequest request, ServletResponse response, Object mappedValue)
|
|
|
@@ -27,6 +30,12 @@ public class AdminFilter extends AccessControlFilter {
|
|
|
|
|
|
AftUser token = TokenManager.getToken();
|
|
|
if (token instanceof Admin) {
|
|
|
+ Admin admin=adminMapper.selectByPrimaryKey(TokenManager.getAdminId());
|
|
|
+ System.out.println(admin.getStatus());
|
|
|
+ if (admin !=null&&admin.getStatus()!=null&&!admin.getStatus().equals("正常")) {
|
|
|
+ shiroFilterUtils.out((HttpServletResponse) response, new Result().error(new Error("", "403", "当前用户已被锁定!")));
|
|
|
+ return Boolean.FALSE;
|
|
|
+ }
|
|
|
return Boolean.TRUE;
|
|
|
}
|
|
|
return Boolean.FALSE;
|