mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-10-29 08:58:22 +08:00
feat(auth): 后台布局注入全局权限集合 UA_AUTH
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
};
|
||||
window.PATH_CONFIG = PATH_CONFIG;
|
||||
</script>
|
||||
<script>window.UA_AUTH = {$uaAuth|raw|default='false'};</script>
|
||||
|
||||
{$content_js|raw}
|
||||
{:sysconfig('site','site_js_insert')}
|
||||
|
||||
@@ -524,6 +524,12 @@ class AdminControllerBase extends BaseController
|
||||
];
|
||||
|
||||
$this->assign($data, -1);
|
||||
|
||||
// 全局权限集合(前端按钮显隐等消费),-1 标记为内部字段,同体 JSON 模式自动剔除
|
||||
$payload = $this->authService->getAuthPayload();
|
||||
$nodeForm = $this->authService->parseNodeStr($thisController . '/index');
|
||||
$payload['controller'] = explode('/', $nodeForm, 2)[0];
|
||||
$this->assign('uaAuth', json_encode($payload, JSON_UNESCAPED_UNICODE | JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP), -1);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user