ComposerUpdate

This commit is contained in:
Anyon 2019-11-18 19:48:56 +08:00
parent 0df129edd9
commit 68d0c9cf59
14 changed files with 37 additions and 36 deletions

View File

@ -16,7 +16,6 @@
namespace app\admin\controller;
use think\admin\Controller;
use think\admin\extend\DataExtend;
use think\admin\service\AuthService;
use think\admin\service\MenuService;
@ -38,9 +37,9 @@ class Index extends Controller
public function index()
{
$this->title = '系统管理后台';
AuthService::instance()->apply(true);
$auth = AuthService::instance()->apply(true);
$this->menus = MenuService::instance()->getTree();
if (empty($this->menus) && !AuthService::instance()->isLogin()) {
if (empty($this->menus) && !$auth->isLogin()) {
$this->redirect(url('@admin/login'));
} else {
$this->fetch();

View File

@ -98,6 +98,13 @@ class Menu extends Controller
protected function _form_filter(&$vo)
{
if ($this->request->isGet()) {
// 选择自己的上级菜单
if (empty($vo['pid']) && $this->request->get('pid', '0')) {
$vo['pid'] = $this->request->get('pid', '0');
}
// 读取系统功能节点
$this->nodes = MenuService::instance()->getList();
// 列出可选上级菜单
$menus = $this->app->db->name($this->table)->where(['status' => '1'])->order('sort desc,id asc')->select()->toArray();
$menus[] = ['title' => '顶级菜单', 'id' => '0', 'pid' => '-1'];
foreach ($this->menus = DataExtend::arr2table($menus) as $key => &$menu) {
@ -106,12 +113,6 @@ class Menu extends Controller
if (stripos("{$menu['path']}-", "{$cur}-") !== false || $menu['path'] === $cur) unset($this->menus[$key]); # 移除与自己相关联的菜单
}
}
// 选择自己的上级菜单
if (empty($vo['pid']) && $this->request->get('pid', '0')) {
$vo['pid'] = $this->request->get('pid', '0');
}
// 读取系统功能节点
$this->nodes = MenuService::instance()->getList();
}
}

View File

@ -15,7 +15,6 @@
namespace app\admin\controller\api;
use app\admin\service\AuthService;
use think\admin\Controller;
use think\admin\Storage;
@ -56,9 +55,6 @@ class Upload extends Controller
*/
public function file()
{
if (!AuthService::isLogin()) {
$this->error('访问授权失败,请重新登录授权再试!');
}
if (!($file = $this->getFile()) || empty($file)) {
return json(['uploaded' => false, 'error' => ['message' => '文件上传异常,文件可能过大或未上传']]);
}

8
composer.lock generated
View File

@ -783,12 +783,12 @@
"source": {
"type": "git",
"url": "https://github.com/zoujingli/ThinkLibrary.git",
"reference": "fedc488cd0d8c8799b8e5620945c0d739a58cbd5"
"reference": "9e636a7be3d7c468cb73c40c48835bf51cef6864"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/fedc488cd0d8c8799b8e5620945c0d739a58cbd5",
"reference": "fedc488cd0d8c8799b8e5620945c0d739a58cbd5",
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/9e636a7be3d7c468cb73c40c48835bf51cef6864",
"reference": "9e636a7be3d7c468cb73c40c48835bf51cef6864",
"shasum": "",
"mirrors": [
{
@ -832,7 +832,7 @@
],
"description": "ThinkPHP v6.0 Development Library",
"homepage": "http://framework.thinkadmin.top",
"time": "2019-11-18T10:46:44+00:00"
"time": "2019-11-18T11:43:36+00:00"
}
],
"packages-dev": [],

2
vendor/autoload.php vendored
View File

@ -4,4 +4,4 @@
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInit5a743c9cd506240941dde8cfe27e723d::getLoader();
return ComposerAutoloaderInitdc48cac423beab724a7102138067b2f9::getLoader();

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit5a743c9cd506240941dde8cfe27e723d
class ComposerAutoloaderInitdc48cac423beab724a7102138067b2f9
{
private static $loader;
@ -19,15 +19,15 @@ class ComposerAutoloaderInit5a743c9cd506240941dde8cfe27e723d
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit5a743c9cd506240941dde8cfe27e723d', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInitdc48cac423beab724a7102138067b2f9', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit5a743c9cd506240941dde8cfe27e723d', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInitdc48cac423beab724a7102138067b2f9', 'loadClassLoader'));
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) {
require_once __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit5a743c9cd506240941dde8cfe27e723d::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInitdc48cac423beab724a7102138067b2f9::getInitializer($loader));
} else {
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
@ -48,19 +48,19 @@ class ComposerAutoloaderInit5a743c9cd506240941dde8cfe27e723d
$loader->register(true);
if ($useStaticLoader) {
$includeFiles = Composer\Autoload\ComposerStaticInit5a743c9cd506240941dde8cfe27e723d::$files;
$includeFiles = Composer\Autoload\ComposerStaticInitdc48cac423beab724a7102138067b2f9::$files;
} else {
$includeFiles = require __DIR__ . '/autoload_files.php';
}
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequire5a743c9cd506240941dde8cfe27e723d($fileIdentifier, $file);
composerRequiredc48cac423beab724a7102138067b2f9($fileIdentifier, $file);
}
return $loader;
}
}
function composerRequire5a743c9cd506240941dde8cfe27e723d($fileIdentifier, $file)
function composerRequiredc48cac423beab724a7102138067b2f9($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
require $file;

View File

@ -4,7 +4,7 @@
namespace Composer\Autoload;
class ComposerStaticInit5a743c9cd506240941dde8cfe27e723d
class ComposerStaticInitdc48cac423beab724a7102138067b2f9
{
public static $files = array (
'9b552a3cc426e3287cc811caefa3cf53' => __DIR__ . '/..' . '/topthink/think-helper/src/helper.php',
@ -470,9 +470,9 @@ class ComposerStaticInit5a743c9cd506240941dde8cfe27e723d
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit5a743c9cd506240941dde8cfe27e723d::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit5a743c9cd506240941dde8cfe27e723d::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit5a743c9cd506240941dde8cfe27e723d::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInitdc48cac423beab724a7102138067b2f9::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitdc48cac423beab724a7102138067b2f9::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitdc48cac423beab724a7102138067b2f9::$classMap;
}, null, ClassLoader::class);
}

View File

@ -805,12 +805,12 @@
"source": {
"type": "git",
"url": "https://github.com/zoujingli/ThinkLibrary.git",
"reference": "fedc488cd0d8c8799b8e5620945c0d739a58cbd5"
"reference": "9e636a7be3d7c468cb73c40c48835bf51cef6864"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/fedc488cd0d8c8799b8e5620945c0d739a58cbd5",
"reference": "fedc488cd0d8c8799b8e5620945c0d739a58cbd5",
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/9e636a7be3d7c468cb73c40c48835bf51cef6864",
"reference": "9e636a7be3d7c468cb73c40c48835bf51cef6864",
"shasum": "",
"mirrors": [
{
@ -826,7 +826,7 @@
"ext-json": "*",
"topthink/framework": "^6.0"
},
"time": "2019-11-18T10:46:44+00:00",
"time": "2019-11-18T11:43:36+00:00",
"type": "library",
"extra": {
"think": {

2
vendor/services.php vendored
View File

@ -1,5 +1,5 @@
<?php
// This file is automatically generated at:2019-11-18 19:31:02
// This file is automatically generated at:2019-11-18 19:45:16
declare (strict_types = 1);
return array (
0 => 'think\\app\\Service',

View File

@ -21,7 +21,6 @@ use think\admin\helper\PageHelper;
use think\admin\helper\QueryHelper;
use think\admin\helper\SaveHelper;
use think\admin\helper\TokenHelper;
use think\admin\service\NodeService;
use think\App;
use think\db\exception\DataNotFoundException;
use think\db\exception\DbException;

View File

@ -113,7 +113,7 @@ class Queue
*/
protected function iswin()
{
return ProcessService::instance($this->app)->iswin();
return ProcessService::instance()->iswin();
}
/**

View File

@ -85,6 +85,7 @@ class AuthService extends Service
/**
* 初始化用户权限
* @param boolean $force 强刷权限
* @return AuthService
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
@ -104,6 +105,7 @@ class AuthService extends Service
$this->app->session->set('user', $user);
}
}
return $this;
}
}

View File

@ -48,6 +48,7 @@ class ProcessService extends Service
/**
* 创建异步进程
* @param string $command 任务指令
* @return ProcessService
*/
public function create($command)
{
@ -57,6 +58,7 @@ class ProcessService extends Service
} else {
pclose(popen("{$command} &", 'r'));
}
return $this;
}
/**

View File

@ -53,11 +53,13 @@ class TokenService extends Service
/**
* 清理表单CSRF信息
* @param string $token
* @return TokenService
*/
public function clearFormToken($token = null)
{
if (is_null($token)) $token = $this->getInputToken();
$this->app->session->delete($token);
return $this;
}
/**