We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b4cb6c2 commit 6935215Copy full SHA for 6935215
2 files changed
application/util/ExceptionHandle.php
@@ -0,0 +1,24 @@
1
+<?php
2
+/**
3
+ * 应用管理
4
+ * @since 2019-10-02
5
+ * @author 何秀钢 <bstdn@126.com>
6
+ */
7
+
8
+namespace app\util;
9
10
+use Exception;
11
+use think\exception\Handle;
12
13
14
+ * Class ExceptionHandle
15
+ * @package app\util
16
+ * 异常处理handle类
17
+ * Detail see: https://www.kancloud.cn/manual/thinkphp5_1/354092
18
19
+class ExceptionHandle extends Handle {
20
21
+ public function render(Exception $e) {
22
+ return parent::render($e)->header(config('apiadmin.CROSS_DOMAIN'));
23
+ }
24
+}
config/app.php
@@ -141,6 +141,6 @@
141
// 显示错误信息
142
'show_error_msg' => false,
143
// 异常处理handle类 留空使用 \think\exception\Handle
144
- 'exception_handle' => '',
+ 'exception_handle' => '\\app\\util\\ExceptionHandle',
145
146
];
0 commit comments