mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-05 19:41:44 +08:00
ComposerUpdate
This commit is contained in:
parent
ab20784645
commit
3ebd978273
@ -1,4 +1,3 @@
|
||||
@echo off
|
||||
@rmdir /s/q vendor
|
||||
composer update --profile --prefer-dist --optimize-autoloader
|
||||
composer dump-autoload --optimize
|
||||
composer update --profile --prefer-dist --no-dev --optimize-autoloader
|
@ -38,11 +38,5 @@
|
||||
"@php think service:discover",
|
||||
"@php think vendor:publish"
|
||||
]
|
||||
},
|
||||
"repositories": {
|
||||
"packagist": {
|
||||
"type": "composer",
|
||||
"url": "https://mirrors.aliyun.com/composer"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
130
composer.lock
generated
130
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": "44a6bc247971794be9edd9df4f3dd0b9",
|
||||
"content-hash": "25a15eb2c8beff5d87d174b5d6f25052",
|
||||
"packages": [
|
||||
{
|
||||
"name": "league/flysystem",
|
||||
@ -18,13 +18,7 @@
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/0e9db7f0b96b9f12dcf6f65bc34b72b1a30ea55a",
|
||||
"reference": "0e9db7f0b96b9f12dcf6f65bc34b72b1a30ea55a",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
|
||||
"preferred": true
|
||||
}
|
||||
]
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-fileinfo": "*",
|
||||
@ -108,13 +102,7 @@
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/thephpleague/flysystem-cached-adapter/zipball/08ef74e9be88100807a3b92cc9048a312bf01d6f",
|
||||
"reference": "08ef74e9be88100807a3b92cc9048a312bf01d6f",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
|
||||
"preferred": true
|
||||
}
|
||||
]
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"league/flysystem": "~1.0",
|
||||
@ -161,13 +149,7 @@
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/opis/closure/zipball/e79f851749c3caa836d7ccc01ede5828feb762c7",
|
||||
"reference": "e79f851749c3caa836d7ccc01ede5828feb762c7",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
|
||||
"preferred": true
|
||||
}
|
||||
]
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^5.4 || ^7.0"
|
||||
@ -228,13 +210,7 @@
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8",
|
||||
"reference": "d11b50ad223250cf17b86e38383413f5a6764bf8",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
|
||||
"preferred": true
|
||||
}
|
||||
]
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.0"
|
||||
@ -280,13 +256,7 @@
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
|
||||
"reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
|
||||
"preferred": true
|
||||
}
|
||||
]
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.0"
|
||||
@ -335,13 +305,7 @@
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-fig/log/zipball/446d54b4cb6bf489fc9d75f55843658e6f25d801",
|
||||
"reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
|
||||
"preferred": true
|
||||
}
|
||||
]
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.0"
|
||||
@ -388,13 +352,7 @@
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
|
||||
"reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
|
||||
"preferred": true
|
||||
}
|
||||
]
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.0"
|
||||
@ -442,13 +400,7 @@
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/top-think/framework/zipball/79c555aab0313d1a33ddcdb3c395f2c47f37f597",
|
||||
"reference": "79c555aab0313d1a33ddcdb3c395f2c47f37f597",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
|
||||
"preferred": true
|
||||
}
|
||||
]
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-json": "*",
|
||||
@ -510,13 +462,7 @@
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/top-think/think-helper/zipball/4d85dfd3778623bbb1de3648f1dcd0c82f4439f4",
|
||||
"reference": "4d85dfd3778623bbb1de3648f1dcd0c82f4439f4",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
|
||||
"preferred": true
|
||||
}
|
||||
]
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.1.0"
|
||||
@ -555,13 +501,7 @@
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/top-think/think-multi-app/zipball/215f4a6bb88e53ad41b448c61957336eb55ce6f9",
|
||||
"reference": "215f4a6bb88e53ad41b448c61957336eb55ce6f9",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
|
||||
"preferred": true
|
||||
}
|
||||
]
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.1.0",
|
||||
@ -605,13 +545,7 @@
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/top-think/think-orm/zipball/ff5f112f5559497222f2716385b5a709ab82741b",
|
||||
"reference": "ff5f112f5559497222f2716385b5a709ab82741b",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
|
||||
"preferred": true
|
||||
}
|
||||
]
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-json": "*",
|
||||
@ -656,13 +590,7 @@
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/top-think/think-template/zipball/e98bdbb4a4c94b442f17dfceba81e0134d4fbd19",
|
||||
"reference": "e98bdbb4a4c94b442f17dfceba81e0134d4fbd19",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
|
||||
"preferred": true
|
||||
}
|
||||
]
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.1.0",
|
||||
@ -699,13 +627,7 @@
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/top-think/think-view/zipball/90803b73f781db5d42619082c4597afc58b2d4c5",
|
||||
"reference": "90803b73f781db5d42619082c4597afc58b2d4c5",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
|
||||
"preferred": true
|
||||
}
|
||||
]
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.1.0",
|
||||
@ -742,13 +664,7 @@
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/zoujingli/ip2region/zipball/f898a7d90cfacd54433de4028190c336164f2ae4",
|
||||
"reference": "f898a7d90cfacd54433de4028190c336164f2ae4",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
|
||||
"preferred": true
|
||||
}
|
||||
]
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3"
|
||||
@ -783,19 +699,13 @@
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/zoujingli/ThinkLibrary.git",
|
||||
"reference": "bb5ec20e7047c582f1ae6e5faea7e3ecdf5a2da6"
|
||||
"reference": "3a4ae06f7b5d19becad14ab8d640dbfde25e146d"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/bb5ec20e7047c582f1ae6e5faea7e3ecdf5a2da6",
|
||||
"reference": "bb5ec20e7047c582f1ae6e5faea7e3ecdf5a2da6",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
|
||||
"preferred": true
|
||||
}
|
||||
]
|
||||
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/3a4ae06f7b5d19becad14ab8d640dbfde25e146d",
|
||||
"reference": "3a4ae06f7b5d19becad14ab8d640dbfde25e146d",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-curl": "*",
|
||||
@ -832,7 +742,7 @@
|
||||
],
|
||||
"description": "ThinkPHP v6.0 Development Library",
|
||||
"homepage": "http://framework.thinkadmin.top",
|
||||
"time": "2019-11-19T02:13:00+00:00"
|
||||
"time": "2019-11-21T02:02:52+00:00"
|
||||
}
|
||||
],
|
||||
"packages-dev": [],
|
||||
|
2
vendor/autoload.php
vendored
2
vendor/autoload.php
vendored
@ -4,4 +4,4 @@
|
||||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInit927a7ea59f5590e9e57c74d6ecc97142::getLoader();
|
||||
return ComposerAutoloaderInitde704791b19bdb4a7631ea3b6593cd21::getLoader();
|
||||
|
1
vendor/composer/autoload_classmap.php
vendored
1
vendor/composer/autoload_classmap.php
vendored
@ -168,6 +168,7 @@ return array(
|
||||
'think\\admin\\service\\MenuService' => $vendorDir . '/zoujingli/think-library/src/service/MenuService.php',
|
||||
'think\\admin\\service\\NodeService' => $vendorDir . '/zoujingli/think-library/src/service/NodeService.php',
|
||||
'think\\admin\\service\\ProcessService' => $vendorDir . '/zoujingli/think-library/src/service/ProcessService.php',
|
||||
'think\\admin\\service\\SystemService' => $vendorDir . '/zoujingli/think-library/src/service/SystemService.php',
|
||||
'think\\admin\\service\\TokenService' => $vendorDir . '/zoujingli/think-library/src/service/TokenService.php',
|
||||
'think\\admin\\storage\\LocalStorage' => $vendorDir . '/zoujingli/think-library/src/storage/LocalStorage.php',
|
||||
'think\\admin\\storage\\QiniuStorage' => $vendorDir . '/zoujingli/think-library/src/storage/QiniuStorage.php',
|
||||
|
14
vendor/composer/autoload_real.php
vendored
14
vendor/composer/autoload_real.php
vendored
@ -2,7 +2,7 @@
|
||||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInit927a7ea59f5590e9e57c74d6ecc97142
|
||||
class ComposerAutoloaderInitde704791b19bdb4a7631ea3b6593cd21
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
@ -19,15 +19,15 @@ class ComposerAutoloaderInit927a7ea59f5590e9e57c74d6ecc97142
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInit927a7ea59f5590e9e57c74d6ecc97142', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInitde704791b19bdb4a7631ea3b6593cd21', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit927a7ea59f5590e9e57c74d6ecc97142', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInitde704791b19bdb4a7631ea3b6593cd21', '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\ComposerStaticInit927a7ea59f5590e9e57c74d6ecc97142::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitde704791b19bdb4a7631ea3b6593cd21::getInitializer($loader));
|
||||
} else {
|
||||
$map = require __DIR__ . '/autoload_namespaces.php';
|
||||
foreach ($map as $namespace => $path) {
|
||||
@ -48,19 +48,19 @@ class ComposerAutoloaderInit927a7ea59f5590e9e57c74d6ecc97142
|
||||
$loader->register(true);
|
||||
|
||||
if ($useStaticLoader) {
|
||||
$includeFiles = Composer\Autoload\ComposerStaticInit927a7ea59f5590e9e57c74d6ecc97142::$files;
|
||||
$includeFiles = Composer\Autoload\ComposerStaticInitde704791b19bdb4a7631ea3b6593cd21::$files;
|
||||
} else {
|
||||
$includeFiles = require __DIR__ . '/autoload_files.php';
|
||||
}
|
||||
foreach ($includeFiles as $fileIdentifier => $file) {
|
||||
composerRequire927a7ea59f5590e9e57c74d6ecc97142($fileIdentifier, $file);
|
||||
composerRequirede704791b19bdb4a7631ea3b6593cd21($fileIdentifier, $file);
|
||||
}
|
||||
|
||||
return $loader;
|
||||
}
|
||||
}
|
||||
|
||||
function composerRequire927a7ea59f5590e9e57c74d6ecc97142($fileIdentifier, $file)
|
||||
function composerRequirede704791b19bdb4a7631ea3b6593cd21($fileIdentifier, $file)
|
||||
{
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
require $file;
|
||||
|
9
vendor/composer/autoload_static.php
vendored
9
vendor/composer/autoload_static.php
vendored
@ -4,7 +4,7 @@
|
||||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInit927a7ea59f5590e9e57c74d6ecc97142
|
||||
class ComposerStaticInitde704791b19bdb4a7631ea3b6593cd21
|
||||
{
|
||||
public static $files = array (
|
||||
'9b552a3cc426e3287cc811caefa3cf53' => __DIR__ . '/..' . '/topthink/think-helper/src/helper.php',
|
||||
@ -259,6 +259,7 @@ class ComposerStaticInit927a7ea59f5590e9e57c74d6ecc97142
|
||||
'think\\admin\\service\\MenuService' => __DIR__ . '/..' . '/zoujingli/think-library/src/service/MenuService.php',
|
||||
'think\\admin\\service\\NodeService' => __DIR__ . '/..' . '/zoujingli/think-library/src/service/NodeService.php',
|
||||
'think\\admin\\service\\ProcessService' => __DIR__ . '/..' . '/zoujingli/think-library/src/service/ProcessService.php',
|
||||
'think\\admin\\service\\SystemService' => __DIR__ . '/..' . '/zoujingli/think-library/src/service/SystemService.php',
|
||||
'think\\admin\\service\\TokenService' => __DIR__ . '/..' . '/zoujingli/think-library/src/service/TokenService.php',
|
||||
'think\\admin\\storage\\LocalStorage' => __DIR__ . '/..' . '/zoujingli/think-library/src/storage/LocalStorage.php',
|
||||
'think\\admin\\storage\\QiniuStorage' => __DIR__ . '/..' . '/zoujingli/think-library/src/storage/QiniuStorage.php',
|
||||
@ -470,9 +471,9 @@ class ComposerStaticInit927a7ea59f5590e9e57c74d6ecc97142
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit927a7ea59f5590e9e57c74d6ecc97142::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit927a7ea59f5590e9e57c74d6ecc97142::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit927a7ea59f5590e9e57c74d6ecc97142::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInitde704791b19bdb4a7631ea3b6593cd21::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInitde704791b19bdb4a7631ea3b6593cd21::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInitde704791b19bdb4a7631ea3b6593cd21::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
128
vendor/composer/installed.json
vendored
128
vendor/composer/installed.json
vendored
@ -12,13 +12,7 @@
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/0e9db7f0b96b9f12dcf6f65bc34b72b1a30ea55a",
|
||||
"reference": "0e9db7f0b96b9f12dcf6f65bc34b72b1a30ea55a",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
|
||||
"preferred": true
|
||||
}
|
||||
]
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-fileinfo": "*",
|
||||
@ -104,13 +98,7 @@
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/thephpleague/flysystem-cached-adapter/zipball/08ef74e9be88100807a3b92cc9048a312bf01d6f",
|
||||
"reference": "08ef74e9be88100807a3b92cc9048a312bf01d6f",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
|
||||
"preferred": true
|
||||
}
|
||||
]
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"league/flysystem": "~1.0",
|
||||
@ -159,13 +147,7 @@
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/opis/closure/zipball/e79f851749c3caa836d7ccc01ede5828feb762c7",
|
||||
"reference": "e79f851749c3caa836d7ccc01ede5828feb762c7",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
|
||||
"preferred": true
|
||||
}
|
||||
]
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^5.4 || ^7.0"
|
||||
@ -228,13 +210,7 @@
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8",
|
||||
"reference": "d11b50ad223250cf17b86e38383413f5a6764bf8",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
|
||||
"preferred": true
|
||||
}
|
||||
]
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.0"
|
||||
@ -282,13 +258,7 @@
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
|
||||
"reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
|
||||
"preferred": true
|
||||
}
|
||||
]
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.0"
|
||||
@ -339,13 +309,7 @@
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-fig/log/zipball/446d54b4cb6bf489fc9d75f55843658e6f25d801",
|
||||
"reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
|
||||
"preferred": true
|
||||
}
|
||||
]
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.0"
|
||||
@ -394,13 +358,7 @@
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
|
||||
"reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
|
||||
"preferred": true
|
||||
}
|
||||
]
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.0"
|
||||
@ -450,13 +408,7 @@
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/top-think/framework/zipball/79c555aab0313d1a33ddcdb3c395f2c47f37f597",
|
||||
"reference": "79c555aab0313d1a33ddcdb3c395f2c47f37f597",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
|
||||
"preferred": true
|
||||
}
|
||||
]
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-json": "*",
|
||||
@ -520,13 +472,7 @@
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/top-think/think-helper/zipball/4d85dfd3778623bbb1de3648f1dcd0c82f4439f4",
|
||||
"reference": "4d85dfd3778623bbb1de3648f1dcd0c82f4439f4",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
|
||||
"preferred": true
|
||||
}
|
||||
]
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.1.0"
|
||||
@ -567,13 +513,7 @@
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/top-think/think-multi-app/zipball/215f4a6bb88e53ad41b448c61957336eb55ce6f9",
|
||||
"reference": "215f4a6bb88e53ad41b448c61957336eb55ce6f9",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
|
||||
"preferred": true
|
||||
}
|
||||
]
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.1.0",
|
||||
@ -619,13 +559,7 @@
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/top-think/think-orm/zipball/ff5f112f5559497222f2716385b5a709ab82741b",
|
||||
"reference": "ff5f112f5559497222f2716385b5a709ab82741b",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
|
||||
"preferred": true
|
||||
}
|
||||
]
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-json": "*",
|
||||
@ -672,13 +606,7 @@
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/top-think/think-template/zipball/e98bdbb4a4c94b442f17dfceba81e0134d4fbd19",
|
||||
"reference": "e98bdbb4a4c94b442f17dfceba81e0134d4fbd19",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
|
||||
"preferred": true
|
||||
}
|
||||
]
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.1.0",
|
||||
@ -717,13 +645,7 @@
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/top-think/think-view/zipball/90803b73f781db5d42619082c4597afc58b2d4c5",
|
||||
"reference": "90803b73f781db5d42619082c4597afc58b2d4c5",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
|
||||
"preferred": true
|
||||
}
|
||||
]
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.1.0",
|
||||
@ -762,13 +684,7 @@
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/zoujingli/ip2region/zipball/f898a7d90cfacd54433de4028190c336164f2ae4",
|
||||
"reference": "f898a7d90cfacd54433de4028190c336164f2ae4",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
|
||||
"preferred": true
|
||||
}
|
||||
]
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3"
|
||||
@ -805,19 +721,13 @@
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/zoujingli/ThinkLibrary.git",
|
||||
"reference": "bb5ec20e7047c582f1ae6e5faea7e3ecdf5a2da6"
|
||||
"reference": "3a4ae06f7b5d19becad14ab8d640dbfde25e146d"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/bb5ec20e7047c582f1ae6e5faea7e3ecdf5a2da6",
|
||||
"reference": "bb5ec20e7047c582f1ae6e5faea7e3ecdf5a2da6",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
|
||||
"preferred": true
|
||||
}
|
||||
]
|
||||
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/3a4ae06f7b5d19becad14ab8d640dbfde25e146d",
|
||||
"reference": "3a4ae06f7b5d19becad14ab8d640dbfde25e146d",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-curl": "*",
|
||||
@ -826,7 +736,7 @@
|
||||
"ext-json": "*",
|
||||
"topthink/framework": "^6.0"
|
||||
},
|
||||
"time": "2019-11-19T02:13:00+00:00",
|
||||
"time": "2019-11-21T02:02:52+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:2019-11-19 10:15:33
|
||||
// This file is automatically generated at:2019-11-21 10:10:23
|
||||
declare (strict_types = 1);
|
||||
return array (
|
||||
0 => 'think\\app\\Service',
|
||||
|
@ -70,7 +70,6 @@ class Controller extends \stdClass
|
||||
$this->app = $app;
|
||||
$this->request = $app->request;
|
||||
$this->app->bind('think\admin\Controller', $this);
|
||||
TokenHelper::instance();
|
||||
if (in_array($this->app->request->action(), get_class_methods(__CLASS__))) {
|
||||
$this->error('Access without permission.');
|
||||
}
|
||||
@ -151,9 +150,7 @@ class Controller extends \stdClass
|
||||
$this->$name = $value;
|
||||
} elseif (is_array($name)) {
|
||||
foreach ($name as $k => $v) {
|
||||
if (is_string($k)) {
|
||||
$this->$k = $v;
|
||||
}
|
||||
if (is_string($k)) $this->$k = $v;
|
||||
}
|
||||
}
|
||||
return $this;
|
||||
|
16
vendor/zoujingli/think-library/src/Helper.php
vendored
16
vendor/zoujingli/think-library/src/Helper.php
vendored
@ -32,18 +32,18 @@ abstract class Helper
|
||||
*/
|
||||
public $app;
|
||||
|
||||
/**
|
||||
* 当前控制器实例
|
||||
* @var Controller
|
||||
*/
|
||||
public $class;
|
||||
|
||||
/**
|
||||
* 数据库实例
|
||||
* @var Query
|
||||
*/
|
||||
protected $query;
|
||||
|
||||
/**
|
||||
* 当前控制器实例
|
||||
* @var Controller
|
||||
*/
|
||||
public $controller;
|
||||
|
||||
/**
|
||||
* Helper constructor.
|
||||
* @param App $app
|
||||
@ -52,11 +52,11 @@ abstract class Helper
|
||||
public function __construct(Controller $controller, App $app)
|
||||
{
|
||||
$this->app = $app;
|
||||
$this->class = $controller;
|
||||
$this->controller = $controller;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数据库查询对象
|
||||
* 获取数据库对象
|
||||
* @param string|Query $dbQuery
|
||||
* @return Query
|
||||
*/
|
||||
|
3
vendor/zoujingli/think-library/src/Queue.php
vendored
3
vendor/zoujingli/think-library/src/Queue.php
vendored
@ -153,9 +153,8 @@ class Queue
|
||||
if (empty($rscript) && $this->app->db->name('SystemQueue')->where($map)->count() > 0) {
|
||||
throw new \think\Exception('该任务已经创建,请耐心等待处理完成!');
|
||||
}
|
||||
$this->code = CodeExtend::uniqidDate(16);
|
||||
$this->app->db->name('SystemQueue')->failException(true)->insert([
|
||||
'code' => $this->code,
|
||||
'code' => $this->code = CodeExtend::uniqidDate(16),
|
||||
'title' => $title,
|
||||
'command' => $command,
|
||||
'attempts' => '0',
|
||||
|
@ -31,12 +31,6 @@ abstract class Service
|
||||
*/
|
||||
protected $app;
|
||||
|
||||
/**
|
||||
* 实例缓存
|
||||
* @var $this
|
||||
*/
|
||||
protected static $cache = [];
|
||||
|
||||
/**
|
||||
* Service constructor.
|
||||
* @param App $app
|
||||
|
@ -92,11 +92,10 @@ class Install extends Command
|
||||
|
||||
protected function installFile()
|
||||
{
|
||||
$service = InstallService::instance();
|
||||
$data = $service->grenerateDifference($this->rules, $this->ignore);
|
||||
$data = InstallService::instance()->grenerateDifference($this->rules, $this->ignore);
|
||||
if (empty($data)) $this->output->info('文件比对一致不需更新文件!');
|
||||
else foreach ($data as $file) {
|
||||
list($state, $mode, $name) = $service->fileSynchronization($file);
|
||||
list($state, $mode, $name) = InstallService::instance()->fileSynchronization($file);
|
||||
if ($state) {
|
||||
if ($mode === 'add') $this->output->info("--- 下载 {$name} 添加成功");
|
||||
if ($mode === 'mod') $this->output->info("--- 下载 {$name} 更新成功");
|
||||
|
122
vendor/zoujingli/think-library/src/common.php
vendored
122
vendor/zoujingli/think-library/src/common.php
vendored
@ -13,9 +13,9 @@
|
||||
// | github 仓库地址 :https://github.com/zoujingli/ThinkLibrary
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
use think\admin\extend\DataExtend;
|
||||
use think\admin\extend\HttpExtend;
|
||||
use think\admin\service\AuthService;
|
||||
use think\admin\service\SystemService;
|
||||
use think\admin\service\TokenService;
|
||||
use think\db\Query;
|
||||
|
||||
@ -47,6 +47,26 @@ if (!function_exists('auth')) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('sysconf')) {
|
||||
/**
|
||||
* 获取或配置系统参数
|
||||
* @param string $name 参数名称
|
||||
* @param string $value 参数内容
|
||||
* @return mixed
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
function sysconf($name = '', $value = null)
|
||||
{
|
||||
if (is_null($value) && is_string($name)) {
|
||||
return SystemService::instance()->get($name);
|
||||
} else {
|
||||
return SystemService::instance()->set($name, $value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('systoken')) {
|
||||
/**
|
||||
* 生成 CSRF-TOKEN 参数
|
||||
@ -60,63 +80,33 @@ if (!function_exists('systoken')) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('format_datetime')) {
|
||||
if (!function_exists('encode')) {
|
||||
/**
|
||||
* 日期格式标准输出
|
||||
* @param string $datetime 输入日期
|
||||
* @param string $format 输出格式
|
||||
* @return false|string
|
||||
* 加密 UTF8 字符串
|
||||
* @param string $content
|
||||
* @return string
|
||||
*/
|
||||
function format_datetime($datetime, $format = 'Y年m月d日 H:i:s')
|
||||
function encode($content)
|
||||
{
|
||||
if (empty($datetime)) return '-';
|
||||
if (is_numeric($datetime)) {
|
||||
return date($format, $datetime);
|
||||
} else {
|
||||
return date($format, strtotime($datetime));
|
||||
}
|
||||
list($chars, $length) = ['', strlen($string = iconv('UTF-8', 'GBK//TRANSLIT', $content))];
|
||||
for ($i = 0; $i < $length; $i++) $chars .= str_pad(base_convert(ord($string[$i]), 10, 36), 2, 0, 0);
|
||||
return $chars;
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('sysconf')) {
|
||||
if (!function_exists('decode')) {
|
||||
/**
|
||||
* 设备或配置系统参数
|
||||
* @param string $name 参数名称
|
||||
* @param string $value 参数内容
|
||||
* @return mixed
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* 解密 UTF8 字符串
|
||||
* @param string $content
|
||||
* @return string
|
||||
*/
|
||||
function sysconf($name = '', $value = null)
|
||||
function decode($content)
|
||||
{
|
||||
$type = 'base';
|
||||
static $data = [];
|
||||
if (stripos($name, '.') !== false) {
|
||||
list($type, $name) = explode('.', $name);
|
||||
}
|
||||
list($field, $filter) = explode('|', "{$name}|");
|
||||
if (!empty($field) && !empty($value)) {
|
||||
if (is_array($value)) {
|
||||
foreach ($value as $k => $v) sysconf("{$field}.{$k}", $v);
|
||||
} else {
|
||||
list($row, $data) = [['name' => $field, 'value' => $value, 'type' => $type], []];
|
||||
return DataExtend::save('SystemConfig', $row, 'name', ['type' => $type]);
|
||||
}
|
||||
} else {
|
||||
if (empty($data)) foreach (app()->db->name('SystemConfig')->select()->toArray() as $vo) {
|
||||
$data[$vo['type']][$vo['name']] = $vo['value'];
|
||||
}
|
||||
if (empty($name)) {
|
||||
return empty($data[$type]) ? [] : (strtolower($filter) === 'raw' ? $data[$type] : array_map(function ($value) {
|
||||
return htmlspecialchars($value);
|
||||
}, $data[$type]));
|
||||
} else {
|
||||
if (isset($data[$type]) && isset($data[$type][$field])) {
|
||||
return strtolower($filter) === 'raw' ? $data[$type][$field] : htmlspecialchars($data[$type][$field]);
|
||||
} else return '';
|
||||
}
|
||||
$chars = '';
|
||||
foreach (str_split($content, 2) as $char) {
|
||||
$chars .= chr(intval(base_convert($char, 36, 10)));
|
||||
}
|
||||
return iconv('GBK//TRANSLIT', 'UTF-8', $chars);
|
||||
}
|
||||
}
|
||||
|
||||
@ -162,36 +152,24 @@ if (!function_exists('data_save')) {
|
||||
*/
|
||||
function data_save($dbQuery, $data, $key = 'id', $where = [])
|
||||
{
|
||||
return DataExtend::save($dbQuery, $data, $key, $where);
|
||||
return SystemService::instance()->save($dbQuery, $data, $key, $where);
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('encode')) {
|
||||
if (!function_exists('format_datetime')) {
|
||||
/**
|
||||
* 加密 UTF8 字符串
|
||||
* @param string $content
|
||||
* @return string
|
||||
* 日期格式标准输出
|
||||
* @param string $datetime 输入日期
|
||||
* @param string $format 输出格式
|
||||
* @return false|string
|
||||
*/
|
||||
function encode($content)
|
||||
function format_datetime($datetime, $format = 'Y年m月d日 H:i:s')
|
||||
{
|
||||
list($chars, $length) = ['', strlen($string = iconv('UTF-8', 'GBK//TRANSLIT', $content))];
|
||||
for ($i = 0; $i < $length; $i++) $chars .= str_pad(base_convert(ord($string[$i]), 10, 36), 2, 0, 0);
|
||||
return $chars;
|
||||
if (empty($datetime)) return '-';
|
||||
if (is_numeric($datetime)) {
|
||||
return date($format, $datetime);
|
||||
} else {
|
||||
return date($format, strtotime($datetime));
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('decode')) {
|
||||
/**
|
||||
* 解密 UTF8 字符串
|
||||
* @param string $content
|
||||
* @return string
|
||||
*/
|
||||
function decode($content)
|
||||
{
|
||||
$chars = '';
|
||||
foreach (str_split($content, 2) as $char) {
|
||||
$chars .= chr(intval(base_convert($char, 36, 10)));
|
||||
}
|
||||
return iconv('GBK//TRANSLIT', 'UTF-8', $chars);
|
||||
}
|
||||
}
|
@ -15,8 +15,6 @@
|
||||
|
||||
namespace think\admin\extend;
|
||||
|
||||
use think\db\Query;
|
||||
|
||||
/**
|
||||
* 数据处理扩展
|
||||
* Class DataExtend
|
||||
@ -24,33 +22,6 @@ use think\db\Query;
|
||||
*/
|
||||
class DataExtend
|
||||
{
|
||||
/**
|
||||
* 数据增量保存
|
||||
* @param Query|string $dbQuery 数据查询对象
|
||||
* @param array $data 需要保存或更新的数据
|
||||
* @param string $key 条件主键限制
|
||||
* @param array $where 其它的where条件
|
||||
* @return boolean|integer
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public static function save($dbQuery, $data, $key = 'id', $where = [])
|
||||
{
|
||||
$app = app();
|
||||
$db = is_string($dbQuery) ? $app->db->name($dbQuery) : $dbQuery;
|
||||
list($table, $value) = [$db->getTable(), isset($data[$key]) ? $data[$key] : null];
|
||||
$map = isset($where[$key]) ? [] : (is_string($value) ? [[$key, 'in', explode(',', $value)]] : [$key => $value]);
|
||||
if (is_array($info = $app->db->table($table)->master()->where($where)->where($map)->find()) && !empty($info)) {
|
||||
if ($app->db->table($table)->strict(false)->where($where)->where($map)->update($data) !== false) {
|
||||
return isset($info[$key]) ? $info[$key] : true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
return $app->db->table($table)->strict(false)->insertGetId($data);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 一维数据数组生成数据树
|
||||
|
@ -62,7 +62,7 @@ class DeleteHelper extends Helper
|
||||
$this->query->whereIn($this->pkField, explode(',', $this->pkValue));
|
||||
}
|
||||
// 前置回调处理
|
||||
if (false === $this->class->callback('_delete_filter', $this->query, $where)) {
|
||||
if (false === $this->controller->callback('_delete_filter', $this->query, $where)) {
|
||||
return null;
|
||||
}
|
||||
// 执行删除操作
|
||||
@ -72,14 +72,14 @@ class DeleteHelper extends Helper
|
||||
$result = $this->query->where($this->where)->delete();
|
||||
}
|
||||
// 结果回调处理
|
||||
if (false === $this->class->callback('_delete_result', $result)) {
|
||||
if (false === $this->controller->callback('_delete_result', $result)) {
|
||||
return $result;
|
||||
}
|
||||
// 回复前端结果
|
||||
if ($result !== false) {
|
||||
$this->class->success('数据删除成功!', '');
|
||||
$this->controller->success('数据删除成功!', '');
|
||||
} else {
|
||||
$this->class->error('数据删除失败, 请稍候再试!');
|
||||
$this->controller->error('数据删除失败, 请稍候再试!');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -15,7 +15,6 @@
|
||||
|
||||
namespace think\admin\helper;
|
||||
|
||||
use think\admin\extend\DataExtend;
|
||||
use think\admin\Helper;
|
||||
use think\db\Query;
|
||||
|
||||
@ -81,19 +80,19 @@ class FormHelper extends Helper
|
||||
$data = (array)$this->query->where($where)->where($this->where)->find();
|
||||
}
|
||||
$data = array_merge($data, $this->data);
|
||||
if (false !== $this->class->callback('_form_filter', $data)) {
|
||||
return $this->class->fetch($this->template, ['vo' => $data]);
|
||||
if (false !== $this->controller->callback('_form_filter', $data)) {
|
||||
return $this->controller->fetch($this->template, ['vo' => $data]);
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
// POST请求, 数据自动存库处理
|
||||
if ($this->app->request->isPost()) {
|
||||
$data = array_merge($this->app->request->post(), $this->data);
|
||||
if (false !== $this->class->callback('_form_filter', $data, $this->where)) {
|
||||
$result = DataExtend::save($this->query, $data, $this->pkField, $this->where);
|
||||
if (false !== $this->class->callback('_form_result', $result, $data)) {
|
||||
if ($result !== false) $this->class->success('恭喜, 数据保存成功!', '');
|
||||
$this->class->error('数据保存失败, 请稍候再试!');
|
||||
if (false !== $this->controller->callback('_form_filter', $data, $this->where)) {
|
||||
$result = data_save($this->query, $data, $this->pkField, $this->where);
|
||||
if (false !== $this->controller->callback('_form_result', $result, $data)) {
|
||||
if ($result !== false) $this->controller->success('恭喜, 数据保存成功!', '');
|
||||
$this->controller->error('数据保存失败, 请稍候再试!');
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
@ -75,9 +75,9 @@ class PageHelper extends Helper
|
||||
$sort = intval(isset($post['sort']) ? $post['sort'] : 0);
|
||||
unset($post['action'], $post['sort']);
|
||||
if ($this->app->db->table($this->query->getTable())->where($post)->update(['sort' => $sort]) !== false) {
|
||||
return $this->class->success('排序参数修改成功!', '');
|
||||
return $this->controller->success('排序参数修改成功!', '');
|
||||
}
|
||||
return $this->class->error('排序参数修改失败,请稍候再试!');
|
||||
return $this->controller->error('排序参数修改失败,请稍候再试!');
|
||||
}
|
||||
// 未配置 order 规则时自动按 sort 字段排序
|
||||
if (!$this->query->getOptions('order') && method_exists($this->query, 'getTableFields')) {
|
||||
@ -98,13 +98,13 @@ class PageHelper extends Helper
|
||||
}
|
||||
$select = "<select onchange='location.href=this.options[this.selectedIndex].value' data-auto-none>" . join('', $options) . "</select>";
|
||||
$html = "<div class='pagination-container nowrap'><span>共 {$paginate->total()} 条记录,每页显示 {$select} 条,共 {$paginate->lastPage()} 页当前显示第 {$paginate->currentPage()} 页。</span>{$paginate->render()}</div>";
|
||||
$this->class->assign('pagehtml', preg_replace('|href="(.*?)"|', 'data-open="$1" onclick="return false" href="$1"', $html));
|
||||
$this->controller->assign('pagehtml', preg_replace('|href="(.*?)"|', 'data-open="$1" onclick="return false" href="$1"', $html));
|
||||
$result = ['page' => ['limit' => intval($limit), 'total' => intval($paginate->total()), 'pages' => intval($paginate->lastPage()), 'current' => intval($paginate->currentPage())], 'list' => $paginate->items()];
|
||||
} else {
|
||||
$result = ['list' => $this->query->select()->toArray()];
|
||||
}
|
||||
if (false !== $this->class->callback('_page_filter', $result['list']) && $this->display) {
|
||||
return $this->class->fetch('', $result);
|
||||
if (false !== $this->controller->callback('_page_filter', $result['list']) && $this->display) {
|
||||
return $this->controller->fetch('', $result);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
@ -71,20 +71,20 @@ class SaveHelper extends Helper
|
||||
if (isset($this->data)) unset($this->data[$this->pkField]);
|
||||
}
|
||||
// 前置回调处理
|
||||
if (false === $this->class->callback('_save_filter', $this->query, $this->data)) {
|
||||
if (false === $this->controller->callback('_save_filter', $this->query, $this->data)) {
|
||||
return false;
|
||||
}
|
||||
// 执行更新操作
|
||||
$result = $this->query->where($this->where)->update($this->data) !== false;
|
||||
// 结果回调处理
|
||||
if (false === $this->class->callback('_save_result', $result)) {
|
||||
if (false === $this->controller->callback('_save_result', $result)) {
|
||||
return $result;
|
||||
}
|
||||
// 回复前端结果
|
||||
if ($result !== false) {
|
||||
$this->class->success('数据更新成功!', '');
|
||||
$this->controller->success('数据更新成功!', '');
|
||||
} else {
|
||||
$this->class->error('数据更新失败, 请稍候再试!');
|
||||
$this->controller->error('数据更新失败, 请稍候再试!');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -34,10 +34,10 @@ class TokenHelper extends Helper
|
||||
*/
|
||||
public function init($return = false)
|
||||
{
|
||||
$this->class->csrf_state = true;
|
||||
$this->controller->csrf_state = true;
|
||||
if ($this->app->request->isPost() && !TokenService::instance()->checkFormToken()) {
|
||||
if ($return) return false;
|
||||
$this->class->error($this->class->csrf_message);
|
||||
$this->controller->error($this->controller->csrf_message);
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
@ -48,7 +48,7 @@ class TokenHelper extends Helper
|
||||
*/
|
||||
public function clear()
|
||||
{
|
||||
TokenService::instance($this->app)->clearFormToken();
|
||||
TokenService::instance()->clearFormToken();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -61,7 +61,7 @@ class TokenHelper extends Helper
|
||||
{
|
||||
throw new HttpResponseException(view($tpl, $vars, 200, function ($html) use ($node) {
|
||||
return preg_replace_callback('/<\/form>/i', function () use ($node) {
|
||||
$csrf = TokenService::instance($this->app)->buildFormToken($node);
|
||||
$csrf = TokenService::instance()->buildFormToken($node);
|
||||
return "<input type='hidden' name='_token_' value='{$csrf['token']}'></form>";
|
||||
}, $html);
|
||||
}));
|
||||
|
@ -21,7 +21,6 @@ use think\console\Command;
|
||||
use think\console\Input;
|
||||
use think\console\input\Argument;
|
||||
use think\console\Output;
|
||||
use think\Container;
|
||||
|
||||
/**
|
||||
* 启动独立执行进程
|
||||
@ -48,7 +47,7 @@ class WorkQueue extends Command
|
||||
*/
|
||||
protected function configure()
|
||||
{
|
||||
$this->setName('xtask:_work')->setDescription('[执行]创建指令任务的进程');
|
||||
$this->setName('xtask:_work')->setDescription('[执行]创建执行任务的进程');
|
||||
$this->addArgument('code', Argument::OPTIONAL, '任务编号');
|
||||
$this->addArgument('splt', Argument::OPTIONAL, '指令结束符');
|
||||
}
|
||||
|
@ -90,7 +90,7 @@ class MenuService extends Service
|
||||
else {
|
||||
$node = join('/', array_slice(explode('/', preg_replace('/[\W]/', '/', $menu['url'])), 0, 3));
|
||||
$menu['url'] = url($menu['url']) . (empty($menu['params']) ? '' : "?{$menu['params']}");
|
||||
if (!AuthService::instance($this->app)->check($node)) unset($menus[$key]);
|
||||
if (!AuthService::instance()->check($node)) unset($menus[$key]);
|
||||
}
|
||||
}
|
||||
return $menus;
|
||||
|
124
vendor/zoujingli/think-library/src/service/SystemService.php
vendored
Normal file
124
vendor/zoujingli/think-library/src/service/SystemService.php
vendored
Normal file
@ -0,0 +1,124 @@
|
||||
<?php
|
||||
|
||||
// +----------------------------------------------------------------------
|
||||
// | ThinkAdmin
|
||||
// +----------------------------------------------------------------------
|
||||
// | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网站: http://demo.thinkadmin.top
|
||||
// +----------------------------------------------------------------------
|
||||
// | 开源协议 ( https://mit-license.org )
|
||||
// +----------------------------------------------------------------------
|
||||
// | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
|
||||
// | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace think\admin\service;
|
||||
|
||||
use think\admin\Service;
|
||||
use think\db\Query;
|
||||
|
||||
/**
|
||||
* 系统参数管理服务
|
||||
* Class SystemService
|
||||
* @package think\admin\service
|
||||
*/
|
||||
class SystemService extends Service
|
||||
{
|
||||
|
||||
/**
|
||||
* 配置数据缓存
|
||||
* @var array
|
||||
*/
|
||||
protected $data = [];
|
||||
|
||||
/**
|
||||
* 设置配置数据
|
||||
* @param string $name 配置名称
|
||||
* @param string $value 配置内容
|
||||
* @return SystemService
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function set($name, $value = '')
|
||||
{
|
||||
list($type, $field) = $this->parse($name);
|
||||
if (is_array($value)) {
|
||||
foreach ($value as $k => $v) $this->set("{$field}.{$k}", $v);
|
||||
} else {
|
||||
$this->data = [];
|
||||
$data = ['name' => $field, 'value' => $value, 'type' => $type];
|
||||
$this->save('SystemConfig', $data, 'name', ['type' => $type]);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 读取配置数据
|
||||
* @param string $name
|
||||
* @return array|mixed|string
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function get($name)
|
||||
{
|
||||
list($type, $field, $outer) = $this->parse($name);
|
||||
if (empty($this->data)) foreach ($this->app->db->name('SystemConfig')->select() as $vo) {
|
||||
$this->data[$vo['type']][$vo['name']] = $vo['value'];
|
||||
}
|
||||
if (empty($name)) {
|
||||
return empty($this->data[$type]) ? [] : ($outer === 'raw' ? $this->data[$type] : array_map(function ($value) {
|
||||
return htmlspecialchars($value);
|
||||
}, $this->data[$type]));
|
||||
} else {
|
||||
if (isset($this->data[$type]) && isset($this->data[$type][$field])) {
|
||||
return $outer === 'raw' ? $this->data[$type][$field] : htmlspecialchars($this->data[$type][$field]);
|
||||
} else return '';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据增量保存
|
||||
* @param Query|string $dbQuery 数据查询对象
|
||||
* @param array $data 需要保存或更新的数据
|
||||
* @param string $key 条件主键限制
|
||||
* @param array $where 其它的where条件
|
||||
* @return bool|int|mixed|string
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function save($dbQuery, $data, $key = 'id', $where = [])
|
||||
{
|
||||
$db = is_string($dbQuery) ? $this->app->db->name($dbQuery) : $dbQuery;
|
||||
list($table, $value) = [$db->getTable(), isset($data[$key]) ? $data[$key] : null];
|
||||
$map = isset($where[$key]) ? [] : (is_string($value) ? [[$key, 'in', explode(',', $value)]] : [$key => $value]);
|
||||
if (is_array($info = $this->app->db->table($table)->master()->where($where)->where($map)->find()) && !empty($info)) {
|
||||
if ($this->app->db->table($table)->strict(false)->where($where)->where($map)->update($data) !== false) {
|
||||
return isset($info[$key]) ? $info[$key] : true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
return $this->app->db->table($table)->strict(false)->insertGetId($data);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析缓存名称
|
||||
* @param string $rule 配置名称
|
||||
* @param string $type 配置类型
|
||||
* @return array
|
||||
*/
|
||||
private function parse($rule, $type = 'base')
|
||||
{
|
||||
if (stripos($rule, '.') !== false) {
|
||||
list($rule, $type) = explode('.', $rule);
|
||||
}
|
||||
list($field, $outer) = explode('|', "{$rule}|");
|
||||
return [$type, $field, strtolower($outer)];
|
||||
}
|
||||
|
||||
}
|
@ -42,7 +42,7 @@ class TokenService extends Service
|
||||
public function checkFormToken($token = null, $node = null)
|
||||
{
|
||||
if (is_null($token)) $token = $this->getInputToken();
|
||||
if (is_null($node)) $node = NodeService::instance($this->app)->getCurrent();
|
||||
if (is_null($node)) $node = NodeService::instance()->getCurrent();
|
||||
// 读取缓存并检查是否有效
|
||||
$cache = $this->app->session->get($token, []);
|
||||
if (empty($cache['node']) || empty($cache['time']) || empty($cache['token'])) return false;
|
||||
@ -75,7 +75,7 @@ class TokenService extends Service
|
||||
if ($item['time'] + 600 < $time) $this->clearFormToken($key);
|
||||
}
|
||||
}
|
||||
$data = ['node' => NodeService::instance($this->app)->fullnode($node), 'token' => $token, 'time' => $time];
|
||||
$data = ['node' => NodeService::instance()->fullnode($node), 'token' => $token, 'time' => $time];
|
||||
$this->app->session->set($token, $data);
|
||||
return $data;
|
||||
}
|
||||
|
@ -92,8 +92,7 @@ class QiniuStorage extends Storage
|
||||
*/
|
||||
public function get($name, $safe = false)
|
||||
{
|
||||
$time = time();
|
||||
$url = $this->url($name, $safe) . "?e={$time}";
|
||||
$url = $this->url($name, $safe) . "?e=" . time();
|
||||
$token = "{$this->accessKey}:{$this->safeBase64(hash_hmac('sha1', $url, $this->secretKey, true))}";
|
||||
return file_get_contents("{$url}&token={$token}");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user