This commit is contained in:
walkor 2022-12-06 15:40:25 +08:00
parent 1cf3572900
commit f4d6d6d2f4
2 changed files with 2 additions and 4 deletions

View File

@ -120,7 +120,7 @@ class AdminRuleController extends Crud
$keys = AdminRule::where('key', 'like', "$controller_search%")
->whereIn('id', $rules)->pluck('key');
$permissions = [];
$prefix_length = strlen($controller);
$prefix_length = strlen($controller) + 1;
foreach ($keys as $key) {
if ($key === $controller) {
$permissions = ['*'];

View File

@ -36,9 +36,7 @@ function toggleSearchFormShow()
* 获取控制器详细权限并决定展示哪些按钮或dom元素
*/
layui.$(function () {
console.trace();
console.log(CONTROLLER);
//if (!window.CONTROLLER) return;
if (typeof CONTROLLER === "undefined") return;
let $ = layui.$;
$.ajax({
url: "/app/admin/admin-rule/permission",