Pre Merge pull request !396 from 六吨/master
This commit is contained in:
commit
9d46ef79aa
|
|
@ -15,6 +15,8 @@ import com.ruoyi.common.exception.ServiceException;
|
||||||
import com.ruoyi.common.utils.ServletUtils;
|
import com.ruoyi.common.utils.ServletUtils;
|
||||||
import com.ruoyi.common.utils.security.PermissionUtils;
|
import com.ruoyi.common.utils.security.PermissionUtils;
|
||||||
|
|
||||||
|
import java.sql.SQLException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 全局异常处理器
|
* 全局异常处理器
|
||||||
*
|
*
|
||||||
|
|
@ -105,6 +107,14 @@ public class GlobalExceptionHandler
|
||||||
return AjaxResult.error(message);
|
return AjaxResult.error(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理数据库连接异常,屏蔽数据库敏感信息。响应e.getMessage()会导致客户端看到SQL语句等。
|
||||||
|
*/
|
||||||
|
@ExceptionHandler(SQLException.class)
|
||||||
|
public AjaxResult dbException(){
|
||||||
|
return AjaxResult.error("系统出现数据库异常!");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 演示模式异常
|
* 演示模式异常
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue