diff --git a/application/admin/common.php b/application/admin/common.php index 502c5348..c9db617f 100755 --- a/application/admin/common.php +++ b/application/admin/common.php @@ -121,7 +121,7 @@ if (!function_exists('build_toolbar')) { $html = []; foreach ($btns as $k => $v) { //如果未定义或没有权限 - if (!isset($btnAttr[$v]) || ($v !== 'refresh' && !$auth->check("{$controller}/{$v}"))) { + if (!isset($btnAttr[$v]) || ($v !== 'refresh' && !$auth->check("{$controller}/{$v}", $auth->id))) { continue; } list($href, $class, $icon, $text, $title) = $btnAttr[$v]; diff --git a/application/admin/lang/zh-cn/index.php b/application/admin/lang/zh-cn/index.php index ea6e26b7..1d8dfba7 100644 --- a/application/admin/lang/zh-cn/index.php +++ b/application/admin/lang/zh-cn/index.php @@ -30,6 +30,7 @@ return [ 'You\'ve logged in, do not login again' => '你已经登录,无需重复登录', 'Username or password can not be empty' => '用户名密码不能为空', 'Username or password is incorrect' => '用户名或密码不正确', + 'Username must be 3 to 30 characters' => '用户名只能由3-30位数字、字母、下划线组合', 'Username is incorrect' => '用户名不正确', 'Password is incorrect' => '密码不正确', 'Admin is forbidden' => '管理员已经被禁止登录', diff --git a/application/common.php b/application/common.php index a014f80b..68b9e582 100755 --- a/application/common.php +++ b/application/common.php @@ -81,15 +81,17 @@ if (!function_exists('cdnurl')) { /** * 获取上传资源的CDN的地址 - * @param string $url 资源相对地址 - * @param boolean $domain 是否显示域名 或者直接传入域名 + * @param string $url 资源相对地址 + * @param boolean|string $domain 是否显示域名 或者直接传入域名 * @return string */ function cdnurl($url, $domain = false) { $regex = "/^((?:[a-z]+:)?\/\/|data:image\/)(.*)/i"; - $cdnurl = \think\Config::get('upload.cdnurl'); - $url = preg_match($regex, $url) || ($cdnurl && stripos($url, $cdnurl) === 0) ? $url : $cdnurl . $url; + if (is_bool($domain)) { + $cdnurl = \think\Config::get('upload.cdnurl'); + $url = preg_match($regex, $url) || ($cdnurl && stripos($url, $cdnurl) === 0) ? $url : $cdnurl . $url; + } if ($domain && !preg_match($regex, $url)) { $domain = is_bool($domain) ? request()->domain() : $domain; $url = $domain . $url; @@ -216,7 +218,7 @@ if (!function_exists('addtion')) { } else { foreach ($fields as $k => $v) { if (is_array($v)) { - $v['field'] = isset($v['field']) ? $v['field'] : $k; + $v['field'] = $v['field'] ?? $k; } else { $v = ['field' => $v]; } @@ -225,12 +227,12 @@ if (!function_exists('addtion')) { } foreach ($fieldsArr as $k => &$v) { $v = is_array($v) ? $v : ['field' => $v]; - $v['display'] = isset($v['display']) ? $v['display'] : str_replace(['_ids', '_id'], ['_names', '_name'], $v['field']); - $v['primary'] = isset($v['primary']) ? $v['primary'] : ''; - $v['column'] = isset($v['column']) ? $v['column'] : 'name'; - $v['model'] = isset($v['model']) ? $v['model'] : ''; - $v['table'] = isset($v['table']) ? $v['table'] : ''; - $v['name'] = isset($v['name']) ? $v['name'] : str_replace(['_ids', '_id'], '', $v['field']); + $v['display'] = $v['display'] ?? str_replace(['_ids', '_id'], ['_names', '_name'], $v['field']); + $v['primary'] = $v['primary'] ?? ''; + $v['column'] = $v['column'] ?? 'name'; + $v['model'] = $v['model'] ?? ''; + $v['table'] = $v['table'] ?? ''; + $v['name'] = $v['name'] ?? str_replace(['_ids', '_id'], '', $v['field']); } unset($v); $ids = []; @@ -323,7 +325,7 @@ if (!function_exists('var_export_short')) { if ($replaced) { $dump = preg_replace_callback("/'##<(\d+)>##'/", function ($matches) use ($replaced) { - return isset($replaced[$matches[1]]) ? $replaced[$matches[1]] : "''"; + return $replaced[$matches[1]] ?? "''"; }, $dump); } diff --git a/public/assets/css/backend.css b/public/assets/css/backend.css index c7aa4c03..8bd3f30d 100644 --- a/public/assets/css/backend.css +++ b/public/assets/css/backend.css @@ -309,14 +309,13 @@ body.is-dialog { html.ios-fix, html.ios-fix body { height: 100%; - overflow: auto; + overflow-x: hidden; -webkit-overflow-scrolling: touch; } html.ios-fix .wrapper, html.ios-fix body .wrapper, html.ios-fix .tab-pane, html.ios-fix body .tab-pane { - overflow: auto; -webkit-overflow-scrolling: touch; } .wrapper { @@ -1049,6 +1048,14 @@ form.form-horizontal .control-label { .bootstrap-table .form-commonsearch .row > .form-group > .control-label { white-space: nowrap; } +.bootstrap-table .btn-commonsearch { + position: relative; +} +.bootstrap-table .btn-commonsearch > span { + position: absolute; + top: -10px; + right: -10px; +} .bootstrap-table .table:not(.table-condensed) > tbody > tr > th, .bootstrap-table .table:not(.table-condensed) > tfoot > tr > th, .bootstrap-table .table:not(.table-condensed) > thead > tr > td, diff --git a/public/assets/js/require-table.js b/public/assets/js/require-table.js index ac94aa68..14f51e70 100755 --- a/public/assets/js/require-table.js +++ b/public/assets/js/require-table.js @@ -132,7 +132,7 @@ define(['jquery', 'bootstrap'], function ($, undefined) { return __('Common search'); }, formatCommonSubmitButton: function () { - return __('Submit'); + return __('Search'); }, formatCommonResetButton: function () { return __('Reset');