| | |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | | import com.zy.asrs.entity.ApiConfig; |
| | | import com.zy.asrs.service.ApiConfigService; |
| | | import com.zy.common.utils.Http; |
| | | import com.zy.system.entity.Permission; |
| | | import com.zy.system.entity.RolePermission; |
| | |
| | | private PermissionService permissionService; |
| | | @Autowired |
| | | private RolePermissionService rolePermissionService; |
| | | @Autowired |
| | | private ApiConfigService apiConfigService; |
| | | |
| | | @Override |
| | | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { |
| | |
| | | return check(request, response, annotation.memo()); |
| | | } |
| | | } |
| | | |
| | | //判断请求路径是否在接口配置中 |
| | | String servletPath = request.getServletPath(); |
| | | ApiConfig apiConfig = apiConfigService.selectByUrl(servletPath); |
| | | if (apiConfig != null) { |
| | | if(apiConfig.getStatus() == 1){ |
| | | //api被禁用 |
| | | Http.response(response, BaseRes.LIMIT); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | |