优化logo判断;增加缺失节点的权限默认配置项;

This commit is contained in:
2022-04-21 10:51:29 +08:00
parent 77433ed601
commit 831a37b9ef
4 changed files with 12 additions and 3 deletions

View File

@@ -46,3 +46,6 @@ STATIC_PATH=/static
# OSS静态文件路径前缀 # OSS静态文件路径前缀
OSS_STATIC_PREFIX=static_ulthon_admin OSS_STATIC_PREFIX=static_ulthon_admin
# 没有节点控制的是否放行
DEFAULT_AUTH_CHECK=false

View File

@@ -10,6 +10,8 @@
// | github开源项目https://github.com/zhongshaofa/EasyAdmin // | github开源项目https://github.com/zhongshaofa/EasyAdmin
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
use think\facade\Env;
return [ return [
// 不需要验证登录的控制器 // 不需要验证登录的控制器
@@ -35,4 +37,6 @@ return [
'login/index', 'login/index',
'login/out', 'login/out',
], ],
];
'default_auth_check' => Env::get('adminsystem.default_auth_check', false)
];

View File

@@ -14,6 +14,7 @@ namespace app\common\service;
use app\common\constants\AdminConstant; use app\common\constants\AdminConstant;
use EasyAdmin\tool\CommonTool; use EasyAdmin\tool\CommonTool;
use think\facade\Config;
use think\facade\Db; use think\facade\Db;
/** /**
@@ -103,7 +104,8 @@ class AuthService
} }
// 判断是否加入节点控制,优先获取缓存信息 // 判断是否加入节点控制,优先获取缓存信息
if (!isset($this->nodeList[$node])) { if (!isset($this->nodeList[$node])) {
return false;
return Config::get('admin.default_auth_check');
} }
$nodeInfo = $this->nodeList[$node]; $nodeInfo = $this->nodeList[$node];
if ($nodeInfo['is_auth'] == 0) { if ($nodeInfo['is_auth'] == 0) {

View File

@@ -85,7 +85,7 @@ define(["jquery", "miniMenu", "miniTheme", "miniTab"], function ($, miniMenu, mi
*/ */
renderLogo: function (data) { renderLogo: function (data) {
var logoHtml = ''; var logoHtml = '';
if (data.image.length != 0) { if (data.image) {
logoHtml = '<img src="' + data.image + '" alt="logo">'; logoHtml = '<img src="' + data.image + '" alt="logo">';
} }
var html = '<a href="' + data.href + '">' + logoHtml + '<h1>' + data.title + '</h1></a>'; var html = '<a href="' + data.href + '">' + logoHtml + '<h1>' + data.title + '</h1></a>';