diff --git a/src/plugin/admin/app/controller/RuleController.php b/src/plugin/admin/app/controller/RuleController.php index 274768e..678eb99 100644 --- a/src/plugin/admin/app/controller/RuleController.php +++ b/src/plugin/admin/app/controller/RuleController.php @@ -211,6 +211,9 @@ class RuleController extends Crud return view('rule/insert'); } $data = $this->insertInput($request); + if (empty($data['type'])) { + $data['type'] = strpos($data['key'], '\\') ? 1 : 0; + } $data['key'] = str_replace('\\\\', '\\', $data['key']); $key = $data['key'] ?? ''; if ($this->model->where('key', $key)->first()) { diff --git a/src/plugin/admin/app/view/user/index.html b/src/plugin/admin/app/view/user/index.html index da4667e..bdd96e2 100644 --- a/src/plugin/admin/app/view/user/index.html +++ b/src/plugin/admin/app/view/user/index.html @@ -75,7 +75,7 @@