use of com.ruoyi.common.core.exception.auth.NotLoginException in project RuoYi-Cloud-Oracle by yangzongzhuan.
the class AuthLogic method getLoginUser.
/**
* 获取当前用户缓存信息, 如果未登录,则抛出异常
*
* @return 用户缓存信息
*/
public LoginUser getLoginUser() {
String token = SecurityUtils.getToken();
if (token == null) {
throw new NotLoginException("未提供token");
}
LoginUser loginUser = SecurityUtils.getLoginUser();
if (loginUser == null) {
throw new NotLoginException("无效的token");
}
return loginUser;
}
use of com.ruoyi.common.core.exception.auth.NotLoginException in project RuoYi-Cloud by yangzongzhuan.
the class AuthLogic method getLoginUser.
/**
* 获取当前用户缓存信息, 如果未登录,则抛出异常
*
* @return 用户缓存信息
*/
public LoginUser getLoginUser() {
String token = SecurityUtils.getToken();
if (token == null) {
throw new NotLoginException("未提供token");
}
LoginUser loginUser = SecurityUtils.getLoginUser();
if (loginUser == null) {
throw new NotLoginException("无效的token");
}
return loginUser;
}
Aggregations