给系统代码增加异常抛出

This commit is contained in:
2024-03-23 16:56:49 +08:00
parent b34a515178
commit 53cd57f160
4 changed files with 20 additions and 3 deletions

View File

@@ -7,6 +7,7 @@ use app\common\controller\AdminController;
use app\common\service\MenuService;
use app\common\service\UploadService;
use think\db\Query;
use think\facade\App;
use think\facade\Cache;
class AjaxBase extends AdminController
@@ -66,7 +67,9 @@ class AjaxBase extends AdminController
$result = $upload_service->save($data['file']);
} catch (\Exception $e) {
throw $e;
if(App::isDebug()){
throw $e;
}
$this->error($e->getMessage());
}
@@ -92,6 +95,9 @@ class AjaxBase extends AdminController
$result = $upload_service->save($data['file']);
} catch (\Exception $e) {
if(App::isDebug()){
throw $e;
}
$this->error($e->getMessage());
}