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

View File

@ -98,6 +98,13 @@ class Menu extends Controller
protected function _form_filter(&$vo) protected function _form_filter(&$vo)
{ {
if ($this->request->isGet()) { 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 = $this->app->db->name($this->table)->where(['status' => '1'])->order('sort desc,id asc')->select()->toArray();
$menus[] = ['title' => '顶级菜单', 'id' => '0', 'pid' => '-1']; $menus[] = ['title' => '顶级菜单', 'id' => '0', 'pid' => '-1'];
foreach ($this->menus = DataExtend::arr2table($menus) as $key => &$menu) { 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 (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; namespace app\admin\controller\api;
use app\admin\service\AuthService;
use think\admin\Controller; use think\admin\Controller;
use think\admin\Storage; use think\admin\Storage;
@ -56,9 +55,6 @@ class Upload extends Controller
*/ */
public function file() public function file()
{ {
if (!AuthService::isLogin()) {
$this->error('访问授权失败,请重新登录授权再试!');
}
if (!($file = $this->getFile()) || empty($file)) { if (!($file = $this->getFile()) || empty($file)) {
return json(['uploaded' => false, 'error' => ['message' => '文件上传异常,文件可能过大或未上传']]); return json(['uploaded' => false, 'error' => ['message' => '文件上传异常,文件可能过大或未上传']]);
} }

8
composer.lock generated
View File

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

2
vendor/autoload.php vendored
View File

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

View File

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

View File

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

2
vendor/services.php vendored
View File

@ -1,5 +1,5 @@
<?php <?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); declare (strict_types = 1);
return array ( return array (
0 => 'think\\app\\Service', 0 => 'think\\app\\Service',

View File

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

View File

@ -113,7 +113,7 @@ class Queue
*/ */
protected function iswin() 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 强刷权限 * @param boolean $force 强刷权限
* @return AuthService
* @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException * @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException * @throws \think\db\exception\ModelNotFoundException
@ -104,6 +105,7 @@ class AuthService extends Service
$this->app->session->set('user', $user); $this->app->session->set('user', $user);
} }
} }
return $this;
} }
} }

View File

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

View File

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