| | |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | | import com.zy.common.properties.SystemProperties; |
| | | import com.zy.common.utils.Http; |
| | | import com.zy.system.entity.*; |
| | | import com.zy.system.service.*; |
| | | import com.zy.system.timer.LicenseTimer; |
| | | import com.zy.system.timer.LoadingConfigTimer; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.lang.Nullable; |
| | |
| | | private PermissionService permissionService; |
| | | @Autowired |
| | | private RolePermissionService rolePermissionService; |
| | | @Autowired |
| | | private LicenseTimer licenseTimer; |
| | | @Autowired |
| | | private LoadingConfigTimer loadingConfigTimer; |
| | | |
| | | @Override |
| | | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { |
| | |
| | | if (deToken != null) { |
| | | long timestamp = Long.parseLong(deToken.substring(0, 13)); |
| | | // 半小时后过期 |
| | | if (System.currentTimeMillis() - timestamp > 1000 * 60 * 30) { |
| | | if (System.currentTimeMillis() - timestamp > loadingConfigTimer.getTokenExpire()) { |
| | | Http.response(response, BaseRes.DENIED); |
| | | return false; |
| | | } |
| | |
| | | // 操作日志 |
| | | if (!Cools.isEmpty(memo)) { |
| | | // 进行激活判断 |
| | | if (!SystemProperties.SYSTEM_ACTIVATION) { |
| | | if (!licenseTimer.getSystemSupport()) { |
| | | Http.response(response, BaseRes.NO_ACTIVATION); |
| | | return false; |
| | | } |