From a499e5a737991461554805af6b72fba65a680776 Mon Sep 17 00:00:00 2001
From: qirong <2032486488@qq.com>
Date: 星期五, 07 四月 2023 11:53:41 +0800
Subject: [PATCH] 更改环境
---
ycl-platform/src/main/java/com/ycl/config/Intercept.java | 33 ++++++++++++++++-----------------
1 files changed, 16 insertions(+), 17 deletions(-)
diff --git a/ycl-platform/src/main/java/com/ycl/config/Intercept.java b/ycl-platform/src/main/java/com/ycl/config/Intercept.java
index b6887d1..3391fea 100644
--- a/ycl-platform/src/main/java/com/ycl/config/Intercept.java
+++ b/ycl-platform/src/main/java/com/ycl/config/Intercept.java
@@ -21,32 +21,31 @@
public class Intercept implements HandlerInterceptor {
@Resource
- NewsAdminService newsAdminService;
- @Resource
NewsIpService newsIpService;
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws IOException {
- List<String> ips = newsIpService.list().stream().map(item->item.getIpAddess()).collect(Collectors.toList());
- if (!ips.contains(request.getRemoteAddr())){
+ List<String> ips = newsIpService.list().stream().map(item -> item.getIpAddess()).collect(Collectors.toList());
+ if (!ips.contains(request.getRemoteAddr())) {
return false;
+
}
- String token = request.getHeader("token");
- JwtTokenUtil jwtTokenUtil = new JwtTokenUtil();
- if (token==null||token.isEmpty()){
+// String token = request.getHeader("token");
+// JwtTokenUtil jwtTokenUtil = new JwtTokenUtil();
+// if (token==null||token.isEmpty()){
// response.sendRedirect("");
// return true;
- throw new ApiException("鐢ㄦ埛鏈櫥褰�");
- }
- AuthInfo authInfo = jwtTokenUtil.parseToken(token);
- if (authInfo == null) {
- throw new ApiException("鏈璇佺敤鎴�");
- }
- if (newsAdminService.getOne(new LambdaQueryWrapper<NewsAdmin>().eq(NewsAdmin::getUsername, authInfo.getUsername())) == null) {
- throw new ApiException("涓嶆槸绯荤粺鐢ㄦ埛");
- } else {
+// throw new ApiException("鐢ㄦ埛鏈櫥褰�");
+// }
+// AuthInfo authInfo = jwtTokenUtil.parseToken(token);
+// if (authInfo == null) {
+// throw new ApiException("鏈璇佺敤鎴�");
+// }
+// if (newsAdminService.getOne(new LambdaQueryWrapper<NewsAdmin>().eq(NewsAdmin::getUsername, authInfo.getUsername())) == null) {
+// throw new ApiException("涓嶆槸绯荤粺鐢ㄦ埛");
+// } else {
return true;
- }
+// }
}
--
Gitblit v1.8.0