🚀 202405重置版

This commit is contained in:
wolfcode
2024-05-13 11:16:20 +08:00
parent 504ab4c4cf
commit a6fd81b0ed
242 changed files with 1169 additions and 2698 deletions

View File

@@ -7,7 +7,9 @@ use app\admin\service\TriggerService;
use app\common\controller\AdminController;
use app\admin\service\annotation\ControllerAnnotation;
use app\admin\service\annotation\NodeAnnotation;
use app\Request;
use think\App;
use think\response\Json;
/**
* Class Config
@@ -28,7 +30,7 @@ class Config extends AdminController
/**
* @NodeAnnotation(title="列表")
*/
public function index()
public function index(Request $request): Json|string
{
return $this->fetch();
}
@@ -36,10 +38,10 @@ class Config extends AdminController
/**
* @NodeAnnotation(title="保存")
*/
public function save()
public function save(Request $request): void
{
$this->checkPostRequest();
$post = $this->request->post();
$post = $request->post();
$notAddFields = ['_token', 'file', 'group'];
try {
$group = $post['group'] ?? '';
@@ -53,7 +55,7 @@ class Config extends AdminController
if (in_array($key, $notAddFields)) continue;
if ($this->model->where('name', $key)->count()) {
$this->model->where('name', $key)->update(['value' => $val,]);
} else {
}else {
$this->model->create(
[
'name' => $key,
@@ -63,8 +65,8 @@ class Config extends AdminController
}
}
TriggerService::updateMenu();
TriggerService::updateSysconfig();
} catch (\Exception $e) {
TriggerService::updatesysConfig();
}catch (\Exception $e) {
$this->error('保存失败');
}
$this->success('保存成功');