mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-05 17:42:49 +08:00
feat: 增加动态设置当前账户的权限功能;增加该功能演示效果
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
<div lay-id="layuiminiDemoTabIdContent" class="layui-tab-item">
|
||||
<div
|
||||
lay-id="layuiminiDemoTabIdContent"
|
||||
class="layui-tab-item"
|
||||
>
|
||||
|
||||
<!-- var的用法,如果变量未声明,则声明,比如a1 -->
|
||||
{var name='a1' value='a1' /}
|
||||
@@ -9,4 +12,24 @@
|
||||
<!-- 与assign区别,即便其他地方已经定义了a3,此处仍然会被定义 -->
|
||||
{assign name='a3' value='a3' /}
|
||||
{$a3}
|
||||
<div class="ul-group-title">
|
||||
动态设置权限
|
||||
</div>
|
||||
<pre>
|
||||
if (date('i') % 2 == 0) {
|
||||
/** @var AuthService $authService */
|
||||
$authService = app(AuthService::class);
|
||||
$authService->disableNode('debug.log/export', false);
|
||||
}
|
||||
</pre>
|
||||
<p>当分钟数为双数时,禁用指定的权限。</p>
|
||||
<p>
|
||||
日志导出权限:
|
||||
{if auth('debug.log/export') }
|
||||
有权限
|
||||
{else /}
|
||||
无权限
|
||||
{/if}
|
||||
</p>
|
||||
<p>{:date('i')}分</p>
|
||||
</div>
|
||||
Reference in New Issue
Block a user