feat: 增加根据状态码判断是否提示

This commit is contained in:
qiufeng
2025-05-19 21:30:06 +08:00
parent 8d1bd1e9a2
commit fdc28efe03
7 changed files with 4 additions and 5 deletions
@@ -3,7 +3,6 @@ package cn.com.mfish.common.core.utils;
import cn.com.mfish.common.core.constants.Constants;
import cn.com.mfish.common.core.constants.RPCConstants;
import cn.com.mfish.common.core.exception.MyRuntimeException;
import cn.com.mfish.common.core.exception.OAuthValidateException;
import cn.com.mfish.common.core.utils.http.WebRequest;
import jakarta.servlet.http.HttpServletRequest;
import lombok.extern.slf4j.Slf4j;
@@ -103,7 +102,7 @@ public class AuthInfoUtils {
public static String getCurrentTenantId() {
String tenantId = getAttr(RPCConstants.REQ_TENANT_ID);
if (StringUtils.isEmpty(tenantId)) {
throw new OAuthValidateException("错误:未获取到租户信息");
throw new MyRuntimeException("错误:未获取到租户信息");
}
return tenantId;
}
@@ -2,6 +2,7 @@ package cn.com.mfish.common.web.aspect;
import cn.com.mfish.common.core.annotation.GlobalException;
import cn.com.mfish.common.core.constants.RPCConstants;
import cn.com.mfish.common.core.exception.MyRuntimeException;
import cn.com.mfish.common.core.exception.OAuthValidateException;
import cn.com.mfish.common.core.utils.ServletUtils;
import cn.com.mfish.common.core.utils.StringUtils;
@@ -33,7 +34,7 @@ public class InnerUserAspect {
public Object innerAround(ProceedingJoinPoint point, InnerUser innerUser) throws Throwable {
HttpServletRequest request = ServletUtils.getRequest();
if (request == null) {
throw new OAuthValidateException("错误:未获取到请求信息");
throw new MyRuntimeException("错误:未获取到请求信息");
}
String source = request.getHeader(RPCConstants.REQ_ORIGIN);
if (StringUtils.isEmpty(source)) {
@@ -2,7 +2,6 @@ package cn.com.mfish.oauth.service.impl;
import cn.com.mfish.common.core.enums.TreeDirection;
import cn.com.mfish.common.core.exception.MyRuntimeException;
import cn.com.mfish.common.core.exception.OAuthValidateException;
import cn.com.mfish.common.core.secret.SM4Utils;
import cn.com.mfish.common.core.utils.AuthInfoUtils;
import cn.com.mfish.common.core.utils.StringUtils;
@@ -415,7 +414,7 @@ public class SsoUserServiceImpl extends ServiceImpl<SsoUserMapper, SsoUser> impl
public UserInfo getUserInfo(String userId) {
SsoUser user = getUserById(userId);
if (user == null) {
throw new OAuthValidateException("错误:未获取到用户信息!userId:" + userId);
throw new MyRuntimeException("错误:未获取到用户信息!userId:" + userId);
}
UserInfo userInfo = new UserInfo();
BeanUtils.copyProperties(user, userInfo);
Binary file not shown.
Binary file not shown.