| | |
| | | import com.core.common.Cools; |
| | | import com.zy.common.properties.SystemProperties; |
| | | import com.zy.common.utils.Http; |
| | | import com.zy.common.utils.SqlInjectionUtils; |
| | | import com.zy.system.entity.*; |
| | | import com.zy.system.service.*; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.lang.reflect.Method; |
| | | import java.util.Date; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * Created by vincent on 2019-06-13 |
| | |
| | | } |
| | | if ("super".equals(deToken.substring(13))) { |
| | | request.setAttribute("userId", 9527); |
| | | Map<String, String[]> parameterMap = request.getParameterMap(); |
| | | if (!Cools.isEmpty(parameterMap) && SqlInjectionUtils.check(JSON.toJSONString(parameterMap))) { |
| | | Http.response(response, "sql注入,请正规访问"); |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | } |
| | |
| | | Http.response(response, BaseRes.LIMIT); |
| | | return false; |
| | | } |
| | | Map<String, String[]> parameterMap = request.getParameterMap(); |
| | | if (!Cools.isEmpty(parameterMap) && SqlInjectionUtils.check(JSON.toJSONString(parameterMap))) { |
| | | Http.response(response, "sql注入,请正规访问"); |
| | | return false; |
| | | } |
| | | |
| | | // 请求缓存 |
| | | request.setAttribute("userId", user.getId()); |
| | | // 更新 token 有效期 |
| | |
| | | |
| | | /** |
| | | * 权限拦截 |
| | | * |
| | | * @return false:无权限; true:认证通过 |
| | | */ |
| | | private boolean limit(String action, User user) { |