优化异常信息

This commit is contained in:
RuoYi
2021-08-16 16:25:25 +08:00
parent 6f51f729ba
commit 03cf98d3c9
19 changed files with 213 additions and 128 deletions

View File

@ -5,7 +5,7 @@ import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import com.ruoyi.common.constant.HttpStatus;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.exception.CustomException;
import com.ruoyi.common.exception.ServiceException;
/**
* 安全服务工具类
@ -25,7 +25,7 @@ public class SecurityUtils
}
catch (Exception e)
{
throw new CustomException("获取用户ID异常", HttpStatus.UNAUTHORIZED);
throw new ServiceException("获取用户ID异常", HttpStatus.UNAUTHORIZED);
}
}
@ -40,7 +40,7 @@ public class SecurityUtils
}
catch (Exception e)
{
throw new CustomException("获取部门ID异常", HttpStatus.UNAUTHORIZED);
throw new ServiceException("获取部门ID异常", HttpStatus.UNAUTHORIZED);
}
}
@ -55,7 +55,7 @@ public class SecurityUtils
}
catch (Exception e)
{
throw new CustomException("获取用户账户异常", HttpStatus.UNAUTHORIZED);
throw new ServiceException("获取用户账户异常", HttpStatus.UNAUTHORIZED);
}
}
@ -70,7 +70,7 @@ public class SecurityUtils
}
catch (Exception e)
{
throw new CustomException("获取用户信息异常", HttpStatus.UNAUTHORIZED);
throw new ServiceException("获取用户信息异常", HttpStatus.UNAUTHORIZED);
}
}