|
@@ -48,19 +48,19 @@ public class AuthenticationInterceptor implements HandlerInterceptor {
|
|
|
// 执行认证
|
|
|
if (token == null) {
|
|
|
//throw new RuntimeException("无token,请重新登录");
|
|
|
- ServletUtils.renderString(httpServletResponse, JSON.toJSONString(AjaxResult.error(HttpStatus.UNAUTHORIZED, "未登陆,请先登录")));
|
|
|
+ ServletUtils.renderString(httpServletResponse, JSON.toJSONString(AjaxResult.error(HttpStatus.UNAUTHORIZED, "未登录,请先登录")));
|
|
|
return false;
|
|
|
}
|
|
|
// 获取 token 中的 loginUser
|
|
|
AppLoginUser loginUser = appTokenService.getLoginUser(token);
|
|
|
if (loginUser == null) {
|
|
|
// throw new RuntimeException("用户不存在,请重新登录");
|
|
|
- ServletUtils.renderString(httpServletResponse, JSON.toJSONString(AjaxResult.error(HttpStatus.UNAUTHORIZED, "未登陆,请先登录")));
|
|
|
+ ServletUtils.renderString(httpServletResponse, JSON.toJSONString(AjaxResult.error(HttpStatus.UNAUTHORIZED, "未登录,请先登录")));
|
|
|
return false;
|
|
|
}
|
|
|
AppMemberVo user = loginUser.getUser();
|
|
|
if (user == null) {
|
|
|
- ServletUtils.renderString(httpServletResponse, JSON.toJSONString(AjaxResult.error(HttpStatus.UNAUTHORIZED, "未登陆,请先登录")));
|
|
|
+ ServletUtils.renderString(httpServletResponse, JSON.toJSONString(AjaxResult.error(HttpStatus.UNAUTHORIZED, "未登录,请先登录")));
|
|
|
return false;
|
|
|
//throw new RuntimeException("用户不存在,请重新登录");
|
|
|
}
|