给系统代码增加异常抛出

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\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) {