| | |
| | | package com.ruoyi.common.security.handler; |
| | | |
| | | import com.ruoyi.common.core.constant.HttpStatus; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.exception.DemoModeException; |
| | | import com.ruoyi.common.core.exception.GlobalException; |
| | | import com.ruoyi.common.core.exception.InnerAuthException; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.common.core.exception.auth.NotPermissionException; |
| | | import com.ruoyi.common.core.exception.auth.NotRoleException; |
| | | import com.ruoyi.common.core.exception.user.StudyLoginException; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import org.slf4j.Logger; |
| | |
| | | * 捕获全局自定义异常 |
| | | */ |
| | | @ExceptionHandler(GlobalException.class) |
| | | public AjaxResult globalExceptionHandler(GlobalException e) { |
| | | return AjaxResult.error(e.getMessage()); |
| | | public R<String> globalExceptionHandler(GlobalException e) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | |
| | | /** |
| | | * 学生端单点登录-异常信息 |
| | | */ |
| | | @ExceptionHandler(StudyLoginException.class) |
| | | public R<String> studyLoginExceptionHandler(StudyLoginException e) { |
| | | return R.fail(e.getCode(), e.getMessage()); |
| | | } |
| | | |
| | | } |