diff --git a/app/admin/controller/User.php b/app/admin/controller/User.php index c4e8b69f1..f7f379a49 100644 --- a/app/admin/controller/User.php +++ b/app/admin/controller/User.php @@ -17,6 +17,7 @@ namespace app\admin\controller; use think\admin\Controller; +use think\admin\service\AdminService; /** * 系统用户管理 @@ -44,7 +45,7 @@ class User extends Controller protected function initialize() { // 超级用户名称 - $this->superName = $this->app->config->get('app.super_user', 'admin'); + $this->superName = AdminService::instance()->getSuperName(); } /** diff --git a/vendor/composer/InstalledVersions.php b/vendor/composer/InstalledVersions.php index 8114b0071..c7cc8db00 100644 --- a/vendor/composer/InstalledVersions.php +++ b/vendor/composer/InstalledVersions.php @@ -32,7 +32,7 @@ private static $installed = array ( 'aliases' => array ( ), - 'reference' => '3cc374d1349454a0a8410869d7a9452461017e24', + 'reference' => 'd53fed33e1f513f043cccc0fbb69b48c0d9fbe41', 'name' => 'zoujingli/thinkadmin', ), 'versions' => @@ -171,7 +171,7 @@ private static $installed = array ( array ( 0 => '9999999-dev', ), - 'reference' => 'cdf95212d42ba02af227e02395259dc4bee9e610', + 'reference' => 'dab37cf567def670988c452943022ff1b8bb4176', ), 'zoujingli/thinkadmin' => array ( @@ -180,7 +180,7 @@ private static $installed = array ( 'aliases' => array ( ), - 'reference' => '3cc374d1349454a0a8410869d7a9452461017e24', + 'reference' => 'd53fed33e1f513f043cccc0fbb69b48c0d9fbe41', ), 'zoujingli/wechat-developer' => array ( diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index cbacb7bc2..7be5818e4 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -849,12 +849,12 @@ "source": { "type": "git", "url": "https://github.com/zoujingli/ThinkLibrary.git", - "reference": "cdf95212d42ba02af227e02395259dc4bee9e610" + "reference": "dab37cf567def670988c452943022ff1b8bb4176" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/cdf95212d42ba02af227e02395259dc4bee9e610", - "reference": "cdf95212d42ba02af227e02395259dc4bee9e610", + "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/dab37cf567def670988c452943022ff1b8bb4176", + "reference": "dab37cf567def670988c452943022ff1b8bb4176", "shasum": "", "mirrors": [ { @@ -871,7 +871,7 @@ "ext-mbstring": "*", "topthink/framework": "^6.0" }, - "time": "2021-05-27T01:59:28+00:00", + "time": "2021-05-27T02:17:00+00:00", "default-branch": true, "type": "library", "extra": { diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 05a4f0f9f..670738fa1 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -6,7 +6,7 @@ 'aliases' => array ( ), - 'reference' => '3cc374d1349454a0a8410869d7a9452461017e24', + 'reference' => 'd53fed33e1f513f043cccc0fbb69b48c0d9fbe41', 'name' => 'zoujingli/thinkadmin', ), 'versions' => @@ -145,7 +145,7 @@ array ( 0 => '9999999-dev', ), - 'reference' => 'cdf95212d42ba02af227e02395259dc4bee9e610', + 'reference' => 'dab37cf567def670988c452943022ff1b8bb4176', ), 'zoujingli/thinkadmin' => array ( @@ -154,7 +154,7 @@ 'aliases' => array ( ), - 'reference' => '3cc374d1349454a0a8410869d7a9452461017e24', + 'reference' => 'd53fed33e1f513f043cccc0fbb69b48c0d9fbe41', ), 'zoujingli/wechat-developer' => array ( diff --git a/vendor/services.php b/vendor/services.php index 88f0ae8cb..0fdc68671 100644 --- a/vendor/services.php +++ b/vendor/services.php @@ -1,5 +1,5 @@ 'think\\admin\\Library', diff --git a/vendor/zoujingli/think-library/src/service/AdminService.php b/vendor/zoujingli/think-library/src/service/AdminService.php index 227f14e57..df3826a7e 100644 --- a/vendor/zoujingli/think-library/src/service/AdminService.php +++ b/vendor/zoujingli/think-library/src/service/AdminService.php @@ -47,7 +47,16 @@ class AdminService extends Service */ public function isSuper(): bool { - return $this->getUserName() === $this->app->config->get('app.super_user', 'admin'); + return $this->getUserName() === $this->getSuperName(); + } + + /** + * 获取超级用户账号 + * @return string + */ + public function getSuperName(): string + { + return $this->app->config->get('app.super_user', 'admin'); } /**