Commit 1233921b866f741333dfbec46a6ea799b9eea6ca
1 parent
0c0a6ae4
fix:【system】refreshAccessToken 时,抛出 UNAUTHORIZED 导致回滚,对应 https://gitee.com/zhiji…
…antianya/yudao-cloud/issues/IDL4OW
Showing
1 changed file
with
2 additions
and
1 deletions
yudao-module-system/src/main/java/cn/iocoder/yudao/module/system/service/oauth2/OAuth2TokenServiceImpl.java
| @@ -6,6 +6,7 @@ import cn.hutool.core.util.IdUtil; | @@ -6,6 +6,7 @@ import cn.hutool.core.util.IdUtil; | ||
| 6 | import cn.hutool.core.util.ObjectUtil; | 6 | import cn.hutool.core.util.ObjectUtil; |
| 7 | import cn.hutool.core.util.StrUtil; | 7 | import cn.hutool.core.util.StrUtil; |
| 8 | import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; | 8 | import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; |
| 9 | +import cn.iocoder.yudao.framework.common.exception.ServiceException; | ||
| 9 | import cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants; | 10 | import cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants; |
| 10 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 11 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 11 | import cn.iocoder.yudao.framework.common.util.date.DateUtils; | 12 | import cn.iocoder.yudao.framework.common.util.date.DateUtils; |
| @@ -68,7 +69,7 @@ public class OAuth2TokenServiceImpl implements OAuth2TokenService { | @@ -68,7 +69,7 @@ public class OAuth2TokenServiceImpl implements OAuth2TokenService { | ||
| 68 | } | 69 | } |
| 69 | 70 | ||
| 70 | @Override | 71 | @Override |
| 71 | - @Transactional(rollbackFor = Exception.class) | 72 | + @Transactional(noRollbackFor = ServiceException.class) |
| 72 | public OAuth2AccessTokenDO refreshAccessToken(String refreshToken, String clientId) { | 73 | public OAuth2AccessTokenDO refreshAccessToken(String refreshToken, String clientId) { |
| 73 | // 查询访问令牌 | 74 | // 查询访问令牌 |
| 74 | OAuth2RefreshTokenDO refreshTokenDO = oauth2RefreshTokenMapper.selectByRefreshToken(refreshToken); | 75 | OAuth2RefreshTokenDO refreshTokenDO = oauth2RefreshTokenMapper.selectByRefreshToken(refreshToken); |