puzhibing
2026-03-25 5f0ff549bc119db30d11aa21dbc335c256c326d3
修改bug
2个文件已修改
12 ■■■■■ 已修改文件
xp-robotaxi-account-boot/src/main/java/com/xiaopeng/account/controller/TokenController.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-common/xp-common-security/src/main/java/com/xiaopeng/common/security/interceptor/HeaderInterceptor.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-account-boot/src/main/java/com/xiaopeng/account/controller/TokenController.java
@@ -61,6 +61,9 @@
    @Value("${sms.appid}")
    private String sms_appid;
    @Value("${token.secret}")
    private String secret;
    // @Autowired
    // private EncryptionDecryptionUtil encryptionDecryptionUtil;
@@ -199,7 +202,7 @@
    public R<?> logout(HttpServletRequest request) {
        String token = SecurityUtils.getToken(request);
        if (StringUtils.isNotEmpty(token)) {
            String username = JwtUtils.getUserName(token);
            String username = JwtUtils.getUserName(token, secret);
            // 删除用户缓存记录
            AuthUtil.logoutByToken(token);
            // 记录用户退出日志
xp-robotaxi-common/xp-common-security/src/main/java/com/xiaopeng/common/security/interceptor/HeaderInterceptor.java
@@ -6,6 +6,8 @@
import com.xiaopeng.api.vo.account.LoginOperationUser;
import com.xiaopeng.api.vo.account.LoginUser;
import com.xiaopeng.common.core.utils.JwtUtils;
import com.xiaopeng.common.core.utils.SpringUtils;
import com.xiaopeng.common.security.service.TokenService;
import io.jsonwebtoken.Claims;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.AsyncHandlerInterceptor;
@@ -24,6 +26,9 @@
 */
public class HeaderInterceptor implements AsyncHandlerInterceptor
{
    private final TokenService tokenService = SpringUtils.getBean(TokenService.class);
    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception
    {
@@ -40,7 +45,7 @@
        String token = SecurityUtils.getToken();
        if (StringUtils.isNotEmpty(token))
        {
            String userType = JwtUtils.getUserType(token);
            String userType = JwtUtils.getUserType(token, tokenService.getSecret());
            if ("system".equals(userType)) {
                LoginUser loginUser = AuthUtil.getLoginUser(token);
                if (StringUtils.isNotNull(loginUser))