@@ -132,12 +132,12 @@ public function add(): void
132132
133133 /**
134134 * 编辑
135- * @param string|null $id
136- * @return void
137135 * @throws Throwable
138136 */
139- public function edit (string $ id = null ): void
137+ public function edit (): void
140138 {
139+ $ pk = $ this ->model ->getPk ();
140+ $ id = $ this ->request ->param ($ pk );
141141 $ row = $ this ->model ->find ($ id );
142142 if (!$ row ) {
143143 $ this ->error (__ ('Record not found ' ));
@@ -187,7 +187,8 @@ public function edit(string $id = null): void
187187 $ pidArr = AdminRule::field ('pid ' )
188188 ->distinct (true )
189189 ->where ('id ' , 'in ' , $ row ->rules )
190- ->select ()->toArray ();
190+ ->select ()
191+ ->toArray ();
191192 $ rules = $ row ->rules ? explode (', ' , $ row ->rules ) : [];
192193 foreach ($ pidArr as $ item ) {
193194 $ ruKey = array_search ($ item ['pid ' ], $ rules );
@@ -261,7 +262,7 @@ public function select(): void
261262 * 权限节点入库前处理
262263 * @throws Throwable
263264 */
264- public function handleRules (array &$ data ): array
265+ private function handleRules (array &$ data ): array
265266 {
266267 if (!empty ($ data ['rules ' ]) && is_array ($ data ['rules ' ])) {
267268 $ rules = AdminRule::select ();
@@ -293,7 +294,7 @@ public function handleRules(array &$data): array
293294 * @return array
294295 * @throws Throwable
295296 */
296- public function getGroups (array $ where = []): array
297+ private function getGroups (array $ where = []): array
297298 {
298299 $ pk = $ this ->model ->getPk ();
299300 $ initKey = $ this ->request ->get ("initKey/s " , $ pk );
@@ -347,7 +348,7 @@ public function getGroups(array $where = []): array
347348 * @return void
348349 * @throws Throwable
349350 */
350- public function checkAuth ($ groupId ): void
351+ private function checkAuth ($ groupId ): void
351352 {
352353 $ authGroups = $ this ->auth ->getAllAuthGroups ($ this ->authMethod );
353354 if (!$ this ->auth ->isSuperAdmin () && !in_array ($ groupId , $ authGroups )) {
0 commit comments