给系统代码增加异常抛出

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());
}

View File

@@ -7,6 +7,7 @@ use app\admin\model\SystemMenu;
use app\admin\model\SystemQuick;
use app\common\controller\AdminController;
use app\common\service\MenuService;
use think\facade\App;
class IndexBase extends AdminController
{
@@ -64,6 +65,9 @@ class IndexBase extends AdminController
->allowField(['head_img', 'phone', 'remark', 'update_time'])
->save($post);
} catch (\Exception $e) {
if (App::isDebug()) {
throw $e;
}
$this->error('保存失败');
}
$save ? $this->success('保存成功') : $this->error('保存失败');
@@ -106,6 +110,9 @@ class IndexBase extends AdminController
'password' => password($post['password']),
]);
} catch (\Exception $e) {
if(App::isDebug()){
throw $e;
}
$this->error('保存失败');
}
if ($save) {

View File

@@ -8,6 +8,7 @@ use app\admin\service\annotation\NodeAnotation;
use app\admin\service\TriggerService;
use app\common\controller\AdminController;
use think\App;
use think\facade\App as FacadeApp;
/**
* Class Config.
@@ -69,6 +70,9 @@ class ConfigBase extends AdminController
TriggerService::updateMenu();
TriggerService::updateSysconfig();
} catch (\Exception $e) {
if (FacadeApp::isDebug()) {
throw $e;
}
$this->error('保存失败');
}
$this->success('保存成功');

View File

@@ -12,12 +12,12 @@ use think\console\Output;
class VersionBase extends Command
{
public const VERSION = 'v2.0.91';
public const VERSION = 'v2.0.92';
public const LAYUI_VERSION = '2.8.17';
public const COMMENT = [
'增加引入文件的版本控制更新',
'给系统代码增加异常抛出',
'发布新版本',
];