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%") $keys = AdminRule::where('key', 'like', "$controller_search%")
->whereIn('id', $rules)->pluck('key'); ->whereIn('id', $rules)->pluck('key');
$permissions = []; $permissions = [];
$prefix_length = strlen($controller); $prefix_length = strlen($controller) + 1;
foreach ($keys as $key) { foreach ($keys as $key) {
if ($key === $controller) { if ($key === $controller) {
$permissions = ['*']; $permissions = ['*'];

View File

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