#
luxiaotao1123
2024-02-13 edfa49f201d3fc8fc6b51b700e91f80246660855
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/common/security/JwtAuthenticationFilter.java
@@ -65,7 +65,7 @@
                User user;
                // 白名单
                if (WHITE_LIST.contains(access_token)) {
                    user = userService.getByUsername("openapi", null);
                    user = userService.getByUsername("root", 1L);
                    if (user == null) {
                        throw new UsernameNotFoundException("Username not found");
                    }
@@ -93,15 +93,16 @@
                        String token = JwtUtil.buildToken(jwtSubject, configProperties.getTokenExpireTime(),
                                configProperties.getTokenKey());
                        response.addHeader(Constants.TOKEN_HEADER_NAME, token);
                        userLoginService.saveAsync(user.getId(), UserLogin.TYPE_REFRESH, null,
                                user.getHostId(), request);
                        userLoginService.saveAsync(user.getId(), UserLogin.TYPE_REFRESH, null, user.getHostId(), request);
                    }
                }
            } catch (ExpiredJwtException e) {
                e.printStackTrace();
                HttpUtils.responseError(response, Constants.TOKEN_EXPIRED_CODE, Constants.TOKEN_EXPIRED_MSG,
                        e.getMessage());
                return;
            } catch (Exception e) {
                e.printStackTrace();
                HttpUtils.responseError(response, Constants.BAD_CREDENTIALS_CODE, Constants.BAD_CREDENTIALS_MSG,
                        e.toString());
                return;