mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-05-29 09:59:15 +08:00
ComposerUpdate
This commit is contained in:
parent
08e026adda
commit
56cd916948
@ -42,10 +42,10 @@ class Plugs extends Controller
|
||||
* 网站压缩发布
|
||||
* @login true
|
||||
*/
|
||||
public function online()
|
||||
public function push()
|
||||
{
|
||||
try {
|
||||
if (AdminService::instance()->getUserName() !== 'admin') {
|
||||
if (AdminService::instance()->isSuper()) {
|
||||
$this->error('只有超级管理员才能操作!');
|
||||
}
|
||||
$this->app->console->call('optimize:route');
|
||||
@ -65,7 +65,7 @@ class Plugs extends Controller
|
||||
public function clear()
|
||||
{
|
||||
try {
|
||||
if (AdminService::instance()->getUserName() !== 'admin') {
|
||||
if (AdminService::instance()->isSuper()) {
|
||||
$this->error('只有超级管理员才能操作!');
|
||||
}
|
||||
$data = SystemService::instance()->getRuntime();
|
||||
@ -86,7 +86,7 @@ class Plugs extends Controller
|
||||
public function debug()
|
||||
{
|
||||
if (input('state')) {
|
||||
if (AdminService::instance()->getUserName() !== 'admin') {
|
||||
if (AdminService::instance()->isSuper()) {
|
||||
$this->error('只有超级管理员才能操作!');
|
||||
}
|
||||
SystemService::instance()->productMode(true);
|
||||
@ -103,7 +103,7 @@ class Plugs extends Controller
|
||||
*/
|
||||
public function optimize()
|
||||
{
|
||||
if (AdminService::instance()->getUserName() !== 'admin') {
|
||||
if (AdminService::instance()->isSuper()) {
|
||||
$this->error('只有超级管理员才能操作!');
|
||||
}
|
||||
$this->_queue('优化数据库所有数据表', 'xadmin:dbOptimize', 0, [], 0, 0);
|
||||
|
@ -51,7 +51,7 @@
|
||||
<dd lay-unselect><a data-modal="{:url('admin/index/info',['id'=>session('user.id')])}"><i class="layui-icon layui-icon-set-fill margin-right-5"></i> 基本资料</a></dd>
|
||||
<dd lay-unselect><a data-modal="{:url('admin/index/pass',['id'=>session('user.id')])}"><i class="layui-icon layui-icon-component margin-right-5"></i> 安全设置</a></dd>
|
||||
{if session('user.username') eq 'admin'}
|
||||
<dd lay-unselect><a data-load="{:url('admin/api.plugs/online')}"><i class="layui-icon layui-icon-template-1 margin-right-5"></i> 缓存加速</a></dd>
|
||||
<dd lay-unselect><a data-load="{:url('admin/api.plugs/push')}"><i class="layui-icon layui-icon-template-1 margin-right-5"></i> 缓存加速</a></dd>
|
||||
<dd lay-unselect><a data-load="{:url('admin/api.plugs/clear')}"><i class="layui-icon layui-icon-fonts-clear margin-right-5"></i> 清理缓存</a></dd>
|
||||
{/if}
|
||||
<dd lay-unselect><a data-load="{:url('admin/login/out')}" data-confirm="确定要退出登录吗?"><i class="layui-icon layui-icon-release margin-right-5"></i> 退出登录</a></dd>
|
||||
|
@ -17,12 +17,14 @@
|
||||
"require": {
|
||||
"php": ">=7.1.0",
|
||||
"ext-gd": "*",
|
||||
"ext-xml": "*",
|
||||
"ext-soap": "*",
|
||||
"ext-json": "*",
|
||||
"ext-curl": "*",
|
||||
"ext-iconv": "*",
|
||||
"ext-openssl": "*",
|
||||
"ext-mbstring": "*",
|
||||
"ext-simplexml": "*",
|
||||
"endroid/qr-code": "^1.9",
|
||||
"topthink/framework": "^6.0",
|
||||
"topthink/think-view": "^1.0",
|
||||
|
14
composer.lock
generated
14
composer.lock
generated
@ -4,7 +4,7 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "c55d51d2e1cb52e013e7635caf4fb45c",
|
||||
"content-hash": "ca7a0ef3ca75a7287eb4c5ecf7e156f3",
|
||||
"packages": [
|
||||
{
|
||||
"name": "endroid/qr-code",
|
||||
@ -909,12 +909,12 @@
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/zoujingli/ThinkLibrary.git",
|
||||
"reference": "e4c99cc5188f842c2842b0822e9e93328932900d"
|
||||
"reference": "692d1f717a5010707d7bd4148d028602f0e3ba00"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/e4c99cc5188f842c2842b0822e9e93328932900d",
|
||||
"reference": "e4c99cc5188f842c2842b0822e9e93328932900d",
|
||||
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/692d1f717a5010707d7bd4148d028602f0e3ba00",
|
||||
"reference": "692d1f717a5010707d7bd4148d028602f0e3ba00",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
@ -958,7 +958,7 @@
|
||||
],
|
||||
"description": "ThinkPHP v6.0 Development Library",
|
||||
"homepage": "http://framework.thinkadmin.top",
|
||||
"time": "2020-04-23T09:59:16+00:00"
|
||||
"time": "2020-04-26T02:44:32+00:00"
|
||||
},
|
||||
{
|
||||
"name": "zoujingli/wechat-developer",
|
||||
@ -1037,12 +1037,14 @@
|
||||
"platform": {
|
||||
"php": ">=7.1.0",
|
||||
"ext-gd": "*",
|
||||
"ext-xml": "*",
|
||||
"ext-soap": "*",
|
||||
"ext-json": "*",
|
||||
"ext-curl": "*",
|
||||
"ext-iconv": "*",
|
||||
"ext-openssl": "*",
|
||||
"ext-mbstring": "*"
|
||||
"ext-mbstring": "*",
|
||||
"ext-simplexml": "*"
|
||||
},
|
||||
"platform-dev": []
|
||||
}
|
||||
|
8
vendor/composer/installed.json
vendored
8
vendor/composer/installed.json
vendored
@ -935,12 +935,12 @@
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/zoujingli/ThinkLibrary.git",
|
||||
"reference": "e4c99cc5188f842c2842b0822e9e93328932900d"
|
||||
"reference": "692d1f717a5010707d7bd4148d028602f0e3ba00"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/e4c99cc5188f842c2842b0822e9e93328932900d",
|
||||
"reference": "e4c99cc5188f842c2842b0822e9e93328932900d",
|
||||
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/692d1f717a5010707d7bd4148d028602f0e3ba00",
|
||||
"reference": "692d1f717a5010707d7bd4148d028602f0e3ba00",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
@ -956,7 +956,7 @@
|
||||
"ext-json": "*",
|
||||
"topthink/framework": "^6.0"
|
||||
},
|
||||
"time": "2020-04-23T09:59:16+00:00",
|
||||
"time": "2020-04-26T02:44:32+00:00",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"think": {
|
||||
|
2
vendor/services.php
vendored
2
vendor/services.php
vendored
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
// This file is automatically generated at:2020-04-26 09:33:53
|
||||
// This file is automatically generated at:2020-04-26 10:47:27
|
||||
declare (strict_types = 1);
|
||||
return array (
|
||||
0 => 'think\\app\\Service',
|
||||
|
@ -27,12 +27,21 @@ class AdminService extends Service
|
||||
{
|
||||
|
||||
/**
|
||||
* 判断是否已经登录
|
||||
* 是否已经登录
|
||||
* @return boolean
|
||||
*/
|
||||
public function isLogin()
|
||||
{
|
||||
return $this->app->session->get('user.id') ? true : false;
|
||||
return $this->getUserId() > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否为超级用户
|
||||
* @return boolean
|
||||
*/
|
||||
public function isSuper()
|
||||
{
|
||||
return $this->getUserName() === 'admin';
|
||||
}
|
||||
|
||||
/**
|
||||
@ -62,8 +71,8 @@ class AdminService extends Service
|
||||
*/
|
||||
public function check($node = '')
|
||||
{
|
||||
if ($this->isSuper()) return true;
|
||||
$service = NodeService::instance();
|
||||
if ($this->app->session->get('user.username') === 'admin') return true;
|
||||
list($real, $nodes) = [$service->fullnode($node), $service->getMethods()];
|
||||
if (!empty($nodes[$real]['isauth'])) {
|
||||
return in_array($real, $this->app->session->get('user.nodes', []));
|
||||
@ -80,11 +89,9 @@ class AdminService extends Service
|
||||
*/
|
||||
public function getTree($checkeds = [])
|
||||
{
|
||||
list($nodes, $pnodes) = [[], []];
|
||||
$methods = array_reverse(NodeService::instance()->getMethods());
|
||||
list($nodes, $pnodes, $methods) = [[], [], array_reverse(NodeService::instance()->getMethods())];
|
||||
foreach ($methods as $node => $method) {
|
||||
$count = substr_count($node, '/');
|
||||
$pnode = substr($node, 0, strripos($node, '/'));
|
||||
list($count, $pnode) = [substr_count($node, '/'), substr($node, 0, strripos($node, '/'))];
|
||||
if ($count === 2 && !empty($method['isauth'])) {
|
||||
in_array($pnode, $pnodes) or array_push($pnodes, $pnode);
|
||||
$nodes[$node] = ['node' => $node, 'title' => $method['title'], 'pnode' => $pnode, 'checked' => in_array($node, $checkeds)];
|
||||
@ -110,7 +117,7 @@ class AdminService extends Service
|
||||
*/
|
||||
public function apply($force = false)
|
||||
{
|
||||
if ($force) $this->app->cache->delete('system_auth_node');
|
||||
if ($force) $this->clearCache();
|
||||
if (($uid = $this->app->session->get('user.id'))) {
|
||||
$user = $this->app->db->name('SystemUser')->where(['id' => $uid])->find();
|
||||
if (($aids = $user['authorize'])) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user