From f3a471c256871021706e65fa237cce67a610e11c Mon Sep 17 00:00:00 2001 From: toogee Date: Thu, 2 Jan 2020 16:23:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B9=BF=E5=91=8A=E5=92=8C=E5=8F=8B=E6=83=85?= =?UTF-8?q?=E9=93=BE=E6=8E=A5=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/controller/AuthRule.php | 2 +- app/admin/model/AuthGroup.php | 6 +- app/index/controller/Article.php | 8 +- app/index/controller/Index.php | 6 +- app/install/config/database.php | 4 +- app/install/controller/index.php | 3 - app/install/data/taoler.sql | 37 ++-- config/database-1.php | 63 ++++++ config/database.php | 4 +- public/static/admin/modules/useradmin.js | 2 +- route/index/route.php | 3 +- vendor/composer/installed.json | 8 +- .../phpmailer/language/phpmailer.lang-af.php | 25 +++ vendor/services.php | 2 +- vendor/symfony/var-dumper/.gitattributes | 3 + .../var-dumper/Caster/ImagineCaster.php | 37 ++++ vendor/symfony/var-dumper/Caster/ImgStub.php | 26 +++ .../symfony/var-dumper/Caster/UuidCaster.php | 30 +++ .../Dumper/ContextualizedDumper.php | 43 +++++ vendor/topthink/think-captcha/src/config.php | 39 ++++ .../think-multi-app/src/command/Build.php | 180 ++++++++++++++++++ .../src/command/stubs/controller.stub | 12 ++ .../think-orm/src/db/connector/Mongo.php | 99 +++++++++- .../think-template/src/facade/Template.php | 83 ++++++++ view/README.md | 1 + view/admin/public/base.html | 2 +- view/admin/public/header.html | 4 +- view/admin/slider/add.html | 17 +- view/admin/slider/edit.html | 21 +- view/admin/slider/index.html | 14 +- view/index/article/cate.html | 2 +- view/index/article/detail.html | 4 +- view/index/index/index.html | 17 +- view/index/login/login.html | 4 +- view/index/public/filter.html | 4 +- view/index/public/flink.html | 2 +- view/index/public/header.html | 4 +- view/index/public/user-nav.html | 10 +- view/install/index/agreement.html | 2 +- view/install/index/test.html | 3 +- 40 files changed, 723 insertions(+), 113 deletions(-) create mode 100644 config/database-1.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-af.php create mode 100644 vendor/symfony/var-dumper/.gitattributes create mode 100644 vendor/symfony/var-dumper/Caster/ImagineCaster.php create mode 100644 vendor/symfony/var-dumper/Caster/ImgStub.php create mode 100644 vendor/symfony/var-dumper/Caster/UuidCaster.php create mode 100644 vendor/symfony/var-dumper/Dumper/ContextualizedDumper.php create mode 100644 vendor/topthink/think-captcha/src/config.php create mode 100644 vendor/topthink/think-multi-app/src/command/Build.php create mode 100644 vendor/topthink/think-multi-app/src/command/stubs/controller.stub create mode 100644 vendor/topthink/think-template/src/facade/Template.php create mode 100644 view/README.md diff --git a/app/admin/controller/AuthRule.php b/app/admin/controller/AuthRule.php index 2f5655f..0203222 100644 --- a/app/admin/controller/AuthRule.php +++ b/app/admin/controller/AuthRule.php @@ -155,7 +155,7 @@ class AuthRule extends AdminController } public function delete($id) - { + { var_dump($id); $rule = AuthRuleModel::find($id); $result = $rule->delete(); if($result){ diff --git a/app/admin/model/AuthGroup.php b/app/admin/model/AuthGroup.php index d8a570a..9bb0d51 100644 --- a/app/admin/model/AuthGroup.php +++ b/app/admin/model/AuthGroup.php @@ -10,9 +10,9 @@ use think\facade\Session; class AuthGroup extends Model { //软删除 - use SoftDelete; - protected $deleteTime = 'delete_time'; - protected $defaultSoftDelete = 0; + //use SoftDelete; + // protected $deleteTime = 'delete_time'; + //protected $defaultSoftDelete = 0; //登陆校验 public function authRuleTree() diff --git a/app/index/controller/Article.php b/app/index/controller/Article.php index c6d8e11..da7ace6 100644 --- a/app/index/controller/Article.php +++ b/app/index/controller/Article.php @@ -54,9 +54,9 @@ class Article extends BaseController // 热议文章 $artHot = ArticleModel::withCount('comments')->where('status',1)->whereTime('create_time', 'year')->order('comments_count','desc')->limit(10)->select(); //分类右栏广告 - $ad_cate = Db::name('slider')->where('slid_status',1)->where('delete_time',0)->where('slid_type',4)->whereTime('slid_over','>=',time())->select(); + $ad_cate = Db::name('slider')->where('slid_status',1)->where('delete_time',0)->where('slid_type',5)->whereTime('slid_over','>=',time())->select(); //通用右栏 - $ad_comm = Db::name('slider')->where('slid_status',1)->where('delete_time',0)->where('slid_type',3)->whereTime('slid_over','>=',time())->select(); + $ad_comm = Db::name('slider')->where('slid_status',1)->where('delete_time',0)->where('slid_type',2)->whereTime('slid_over','>=',time())->select(); View::assign(['type'=>$types,'artList'=>$artList,'artHot'=>$artHot,'ad_cate'=>$ad_cate,'ad_comm'=>$ad_comm]); return View::fetch(); @@ -89,9 +89,9 @@ class Article extends BaseController // 热议文章 $artHot = ArticleModel::withCount('comments')->where('status',1)->whereTime('create_time', 'year')->order('comments_count','desc')->limit(10)->select(); //文章广告 - $ad_article = Db::name('slider')->where('slid_status',1)->where('delete_time',0)->where('slid_type',3)->whereTime('slid_over','>=',time())->select(); + $ad_article = Db::name('slider')->where('slid_status',1)->where('delete_time',0)->where('slid_type',4)->whereTime('slid_over','>=',time())->select(); //通用右栏 - $ad_comm = Db::name('slider')->where('slid_status',1)->where('delete_time',0)->where('slid_type',3)->whereTime('slid_over','>=',time())->select(); + $ad_comm = Db::name('slider')->where('slid_status',1)->where('delete_time',0)->where('slid_type',2)->whereTime('slid_over','>=',time())->select(); View::assign(['article'=>$article,'artHot'=>$artHot,'ad_art'=>$ad_article,'ad_comm'=>$ad_comm]); return View::fetch(); } diff --git a/app/index/controller/Index.php b/app/index/controller/Index.php index ad3194f..ed87f78 100644 --- a/app/index/controller/Index.php +++ b/app/index/controller/Index.php @@ -33,13 +33,13 @@ class Index extends BaseController $artHot = Article::withCount('comments')->field('title,comments_count')->where(['status'=>1,'delete_time'=>0])->whereTime('create_time', 'year')->order('comments_count','desc')->limit(10)->select(); //首页赞助 - $ad_index = Db::name('slider')->where('slid_status',1)->where('delete_time',0)->where('slid_type',2)->whereTime('slid_over','>=',time())->select(); + $ad_index = Db::name('slider')->where('slid_status',1)->where('delete_time',0)->where('slid_type',3)->whereTime('slid_over','>=',time())->select(); //首页右栏 - $ad_comm = Db::name('slider')->where('slid_status',1)->where('delete_time',0)->where('slid_type',3)->whereTime('slid_over','>=',time())->select(); + $ad_comm = Db::name('slider')->where('slid_status',1)->where('delete_time',0)->where('slid_type',2)->whereTime('slid_over','>=',time())->select(); //友情链接 - $friend_links = Db::name('friend_link')->field('linkname,linksrc')->select(); + $friend_links = Db::name('slider')->where('slid_status',1)->where('delete_time',0)->where('slid_type',6)->whereTime('slid_over','>=',time())->field('slid_name,slid_href')->select(); $vs = [ 'slider' => $sliders, diff --git a/app/install/config/database.php b/app/install/config/database.php index e6fd56a..6b56914 100644 --- a/app/install/config/database.php +++ b/app/install/config/database.php @@ -8,11 +8,11 @@ return [ // 服务器地址 'hostname' => '127.0.0.1', // 数据库名 - 'database' => '', + 'database' => 'taotao', // 用户名 'username' => 'root', // 密码 - 'password' => '', + 'password' => 'root', // 端口 'hostport' => '3306', // 数据库连接参数 diff --git a/app/install/controller/index.php b/app/install/controller/index.php index 11d51a4..2a4cbeb 100644 --- a/app/install/controller/index.php +++ b/app/install/controller/index.php @@ -127,11 +127,8 @@ php; //管理员 $table_admin = $data['DB_PREFIX'] . "admin"; - $table_user = $data['DB_PREFIX'] . "user"; $sql_admin = "UPDATE $table_admin SET username = '{$username}', password = '{$pass}', status=1,create_time = '{$create_time}' WHERE id = 1"; - $sql_user = "UPDATE $table_user SET name = '{$username}', password = '{$pass}', status=1, auth=1, create_time = '{$create_time}' WHERE id = 1"; $db->execute($sql_admin); - $db->execute($sql_user); Db::getConnection()->close(); } diff --git a/app/install/data/taoler.sql b/app/install/data/taoler.sql index 5e91c8c..0b70957 100644 --- a/app/install/data/taoler.sql +++ b/app/install/data/taoler.sql @@ -297,26 +297,6 @@ INSERT INTO `tao_comment` VALUES ('74', 'face[给力] ', '14', '2', '0', '1', '1 INSERT INTO `tao_comment` VALUES ('75', 'face[微笑] ', '8', '2', '0', '0', '1555124079', '1555127399', '0'); INSERT INTO `tao_comment` VALUES ('76', 'face[微笑] 好美呀,', '7', '3', '0', '0', '1555131857', '1555131857', '0'); -/* Table structure for tao_friend_link */ - -DROP TABLE IF EXISTS `tao_friend_link`; -CREATE TABLE `tao_friend_link` ( - `id` int(2) unsigned NOT NULL AUTO_INCREMENT COMMENT '友情链接id', - `linkname` varchar(10) NOT NULL COMMENT '链接名称', - `linksrc` varchar(60) NOT NULL COMMENT '链接地址', - `linkimg` varchar(60) NOT NULL COMMENT '链接图片', - `creat_time` int(10) NOT NULL COMMENT '创建时间', - `update_time` int(10) NOT NULL COMMENT '更新时间', - `delete_time` int(10) NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; - -/* Records of tao_friend_link */ - -INSERT INTO `tao_friend_link` VALUES ('1', 'ThinkPHP', 'https://www.thinkphp.cn', '', '0', '0', '0'); -INSERT INTO `tao_friend_link` VALUES ('2', 'Layui', 'https://www.layui.com', '', '0', '0', '0'); -INSERT INTO `tao_friend_link` VALUES ('3', 'TaoLer', 'http://www.aieok.com', '', '0', '0', '0'); - /* Table structure for tao_mail_server */ DROP TABLE IF EXISTS `tao_mail_server`; @@ -344,6 +324,7 @@ CREATE TABLE `tao_slider` ( `slid_type` tinyint(1) NOT NULL DEFAULT '1' COMMENT '类型', `slid_img` varchar(70) NOT NULL COMMENT '幻灯图片地址', `slid_href` varchar(70) NOT NULL COMMENT '链接', + `slid_color` varchar(10) NOT NULL COMMENT '广告块颜色', `slid_start` int(11) NOT NULL COMMENT '开始时间', `slid_over` int(11) NOT NULL COMMENT '结束时间', `slid_status` enum('1','0') NOT NULL DEFAULT '1' COMMENT '1投放0仓库', @@ -355,11 +336,15 @@ CREATE TABLE `tao_slider` ( /* Records of tao_slider */ -INSERT INTO `tao_slider` VALUES ('1', 'CODING', '1', '/uploads/images/F1.jpg', '#', '1574870400', '1575043200', '1', '0', '0', '0'); -INSERT INTO `tao_slider` VALUES ('2', '无人机', '1', '/uploads/images/F2.jpg', 'www.taobao.com', '-28800', '1606665600', '1', '0', '0', '0'); -INSERT INTO `tao_slider` VALUES ('3', 'keji', '2', '/storage/slider/20191210/6e6486b81a5b07be4425b676513b0334.jpg', 'http://www.baidu.com', '1571155200', '1577721600', '1', '0', '0', '0'); -INSERT INTO `tao_slider` VALUES ('4', '科技', '3', '/storage/slider/20191210/d35a49fda5839d4b27f65076fb57b7f2.jpg', '4', '1575907200', '1609344000', '1', '0', '0', '0'); -INSERT INTO `tao_slider` VALUES ('5', '科学', '4', '/storage/slider/20191210/e87f15527f32e690538671753010fd00.jpg', '大', '-28800', '1609344000', '1', '0', '0', '0'); +INSERT INTO `tao_slider` VALUES ('1', 'CODING', '1', '/storage/slider/F1.jpg', '#', '', '1574870400', '1575043200', '1', '0', '0', '0'); +INSERT INTO `tao_slider` VALUES ('2', '无人机', '1', '/storage/slider/F2.jpg', 'www.taobao.com', '', '-28800', '1606665600', '1', '0', '0', '0'); +INSERT INTO `tao_slider` VALUES ('3', '通用右栏底部广告', '2', '/storage/slider/20191210/6e6486b81a5b07be4425b676513b0334.jpg', 'http://www.aieok.com', '', '1571155200', '1609344000', '1', '0', '0', '0'); +INSERT INTO `tao_slider` VALUES ('4', '科技', '3', '/storage/slider/20191210/d35a49fda5839d4b27f65076fb57b7f2.jpg', '4', '', '1575907200', '1609344000', '1', '0', '0', '0'); +INSERT INTO `tao_slider` VALUES ('5', '科学', '4', '/storage/slider/20191210/e87f15527f32e690538671753010fd00.jpg', '大', '', '-28800', '1609344000', '1', '0', '0', '0'); +INSERT INTO `tao_slider` VALUES ('6', '更快更好的PHP快速开发框架', '5', '', 'http://www.thinkphp.cn', '', '1577894400', '1640880000', '1', '0', '0', '0'); +INSERT INTO `tao_slider` VALUES ('7', 'Layui前端框架', '6', '', 'https://www.layui.com', '', '1577894400', '1612022400', '1', '0', '0', '0'); +INSERT INTO `tao_slider` VALUES ('8', 'ThinkPHP框架', '6', '', 'http://www.thinkphp.cn/', '', '1577894400', '1612022400', '1', '0', '0', '0'); +INSERT INTO `tao_slider` VALUES ('9', 'Taoler社区系统', '6', '', 'http://www.aieok.com', '', '1577894400', '2147483647', '1', '0', '0', '0'); /* Table structure for tao_system */ @@ -391,7 +376,7 @@ CREATE TABLE `tao_system` ( /* Records of tao_system */ -INSERT INTO `tao_system` VALUES ('1', 'TaoLer社区', '淘宝卖家交流平台', 'http://www.tp6.com', '/storage/logo/20191024/a5671b2c16a37ec8587f31989dab1177.png', 'aieok.com 版权所有', '淘宝,卖家,TaoLer社区', '这是一个社区论坛', '1', '1', '1', '0.0.0.0', '管理员|admin|审核员|超级|垃圾', '1.1.1', '', 'http://www.aieok.com/api/index/cy', 'http://www.aieok.com/api/upload/check', 'http://www.aieok.com/api/upload/api', '0', '1577419197', '0'); +INSERT INTO `tao_system` VALUES ('1', 'TaoLer社区', '社区交流平台', '', '/storage/logo/20191024/a5671b2c16a37ec8587f31989dab1177.png', 'aieok.com 版权所有', '淘宝,卖家,TaoLer社区', '这是一个社区论坛', '1', '1', '1', '0.0.0.0', '管理员|admin|审核员|超级|垃圾', '1.0.0', '', 'http://www.aieok.com/api/index/cy', 'http://www.aieok.com/api/upload/check', 'http://www.aieok.com/api/upload/api', '0', '1577419197', '0'); /* Table structure for tao_user */ diff --git a/config/database-1.php b/config/database-1.php new file mode 100644 index 0000000..dcff575 --- /dev/null +++ b/config/database-1.php @@ -0,0 +1,63 @@ + Env::get('database.driver', 'mysql'), + + // 自定义时间查询规则 + 'time_query_rule' => [], + + // 自动写入时间戳字段 + // true为自动识别类型 false关闭 + // 字符串则明确指定时间字段类型 支持 int timestamp datetime date + 'auto_timestamp' => true, + + // 时间字段取出后的默认时间格式 + 'datetime_format' => 'Y-m-d H:i:s', + + // 数据库连接配置信息 + 'connections' => [ + 'mysql' => [ + // 数据库类型 + 'type' => Env::get('database.type', 'mysql'), + // 服务器地址 + 'hostname' => Env::get('database.hostname', '127.0.0.1'), + // 数据库名 + 'database' => Env::get('database.database', ''), + // 用户名 + 'username' => Env::get('database.username', 'root'), + // 密码 + 'password' => Env::get('database.password', ''), + // 端口 + 'hostport' => Env::get('database.hostport', '3306'), + // 数据库连接参数 + 'params' => [], + // 数据库编码默认采用utf8 + 'charset' => Env::get('database.charset', 'utf8'), + // 数据库表前缀 + 'prefix' => Env::get('database.prefix', ''), + + // 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器) + 'deploy' => 0, + // 数据库读写是否分离 主从式有效 + 'rw_separate' => false, + // 读写分离后 主服务器数量 + 'master_num' => 1, + // 指定从服务器序号 + 'slave_no' => '', + // 是否严格检查字段是否存在 + 'fields_strict' => true, + // 是否需要断线重连 + 'break_reconnect' => false, + // 监听SQL + 'trigger_sql' => true, + // 开启字段缓存 + 'fields_cache' => false, + // 字段缓存路径 + 'schema_cache_path' => app()->getRuntimePath() . 'schema' . DIRECTORY_SEPARATOR, + ], + + // 更多的数据库配置信息 + ], +]; \ No newline at end of file diff --git a/config/database.php b/config/database.php index fb2cb4f..61ae363 100644 --- a/config/database.php +++ b/config/database.php @@ -16,11 +16,11 @@ return [ // 服务器地址 'hostname' => '127.0.0.1', // 数据库名 - 'database' => '', + 'database' => 'taotao', // 用户名 'username' => 'root', // 密码 - 'password' => '', + 'password' => 'root', // 端口 'hostport' => '3306', // 数据库连接参数 diff --git a/public/static/admin/modules/useradmin.js b/public/static/admin/modules/useradmin.js index f04dbe5..ae783c6 100644 --- a/public/static/admin/modules/useradmin.js +++ b/public/static/admin/modules/useradmin.js @@ -374,7 +374,7 @@ layui.define(['table', 'form'], function(exports){ layer.close(index); layer.confirm('确定删除此权限?', function(index){ //obj.del(); - console.log(data.id); + //console.log(data.id); $.ajax({ type:'post', url:"/admin/authrule/delete", diff --git a/route/index/route.php b/route/index/route.php index 5ea7ba3..d16ac3e 100644 --- a/route/index/route.php +++ b/route/index/route.php @@ -14,7 +14,8 @@ Route::group(function () { Route::get('jie/:id', 'article/detail'); Route::get('column///','article/cate'); Route::rule('add','article/add'); - Route::rule('del:id','/article/delete'); + Route::rule('del/:id','article/delete'); + Route::rule('edit/:id','article/edit'); }); Route::group(function () { Route::rule('u/:id', 'user/home'); diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 26b713a..430cce1 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -954,12 +954,12 @@ "source": { "type": "git", "url": "https://github.com/top-think/think-orm.git", - "reference": "444277e2acff186a8066a8a42912ebea01d948c5" + "reference": "a343dbb39fc51a09e78a68e7968dc8e8060c4a66" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/top-think/think-orm/zipball/444277e2acff186a8066a8a42912ebea01d948c5", - "reference": "444277e2acff186a8066a8a42912ebea01d948c5", + "url": "https://api.github.com/repos/top-think/think-orm/zipball/a343dbb39fc51a09e78a68e7968dc8e8060c4a66", + "reference": "a343dbb39fc51a09e78a68e7968dc8e8060c4a66", "shasum": "", "mirrors": [ { @@ -975,7 +975,7 @@ "psr/simple-cache": "^1.0", "topthink/think-helper": "^3.1" }, - "time": "2019-12-28T13:25:27+00:00", + "time": "2020-01-01T12:36:51+00:00", "type": "library", "installation-source": "dist", "autoload": { diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-af.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-af.php new file mode 100644 index 0000000..3c42d78 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-af.php @@ -0,0 +1,25 @@ + 'think\\captcha\\CaptchaService', diff --git a/vendor/symfony/var-dumper/.gitattributes b/vendor/symfony/var-dumper/.gitattributes new file mode 100644 index 0000000..ebb9287 --- /dev/null +++ b/vendor/symfony/var-dumper/.gitattributes @@ -0,0 +1,3 @@ +/Tests export-ignore +/phpunit.xml.dist export-ignore +/.gitignore export-ignore diff --git a/vendor/symfony/var-dumper/Caster/ImagineCaster.php b/vendor/symfony/var-dumper/Caster/ImagineCaster.php new file mode 100644 index 0000000..d1289da --- /dev/null +++ b/vendor/symfony/var-dumper/Caster/ImagineCaster.php @@ -0,0 +1,37 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\VarDumper\Caster; + +use Imagine\Image\ImageInterface; +use Symfony\Component\VarDumper\Cloner\Stub; + +/** + * @author Grégoire Pineau + */ +final class ImagineCaster +{ + public static function castImage(ImageInterface $c, array $a, Stub $stub, bool $isNested): array + { + $imgData = $c->get('png'); + if (\strlen($imgData) > 1 * 1000 * 1000) { + $a += [ + Caster::PREFIX_VIRTUAL.'image' => new ConstStub($c->getSize()), + ]; + } else { + $a += [ + Caster::PREFIX_VIRTUAL.'image' => new ImgStub($imgData, 'image/png', $c->getSize()), + ]; + } + + return $a; + } +} diff --git a/vendor/symfony/var-dumper/Caster/ImgStub.php b/vendor/symfony/var-dumper/Caster/ImgStub.php new file mode 100644 index 0000000..05789fe --- /dev/null +++ b/vendor/symfony/var-dumper/Caster/ImgStub.php @@ -0,0 +1,26 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\VarDumper\Caster; + +/** + * @author Grégoire Pineau + */ +class ImgStub extends ConstStub +{ + public function __construct(string $data, string $contentType, string $size) + { + $this->value = ''; + $this->attr['img-data'] = $data; + $this->attr['img-size'] = $size; + $this->attr['content-type'] = $contentType; + } +} diff --git a/vendor/symfony/var-dumper/Caster/UuidCaster.php b/vendor/symfony/var-dumper/Caster/UuidCaster.php new file mode 100644 index 0000000..b102774 --- /dev/null +++ b/vendor/symfony/var-dumper/Caster/UuidCaster.php @@ -0,0 +1,30 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\VarDumper\Caster; + +use Ramsey\Uuid\UuidInterface; +use Symfony\Component\VarDumper\Cloner\Stub; + +/** + * @author Grégoire Pineau + */ +final class UuidCaster +{ + public static function castRamseyUuid(UuidInterface $c, array $a, Stub $stub, bool $isNested): array + { + $a += [ + Caster::PREFIX_VIRTUAL.'uuid' => (string) $c, + ]; + + return $a; + } +} diff --git a/vendor/symfony/var-dumper/Dumper/ContextualizedDumper.php b/vendor/symfony/var-dumper/Dumper/ContextualizedDumper.php new file mode 100644 index 0000000..7638417 --- /dev/null +++ b/vendor/symfony/var-dumper/Dumper/ContextualizedDumper.php @@ -0,0 +1,43 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\VarDumper\Dumper; + +use Symfony\Component\VarDumper\Cloner\Data; +use Symfony\Component\VarDumper\Dumper\ContextProvider\ContextProviderInterface; + +/** + * @author Kévin Thérage + */ +class ContextualizedDumper implements DataDumperInterface +{ + private $wrappedDumper; + private $contextProviders; + + /** + * @param ContextProviderInterface[] $contextProviders + */ + public function __construct(DataDumperInterface $wrappedDumper, array $contextProviders) + { + $this->wrappedDumper = $wrappedDumper; + $this->contextProviders = $contextProviders; + } + + public function dump(Data $data) + { + $context = []; + foreach ($this->contextProviders as $contextProvider) { + $context[\get_class($contextProvider)] = $contextProvider->getContext(); + } + + $this->wrappedDumper->dump($data->withContext($context)); + } +} diff --git a/vendor/topthink/think-captcha/src/config.php b/vendor/topthink/think-captcha/src/config.php new file mode 100644 index 0000000..9bbf529 --- /dev/null +++ b/vendor/topthink/think-captcha/src/config.php @@ -0,0 +1,39 @@ + 5, + // 验证码字符集合 + 'codeSet' => '2345678abcdefhijkmnpqrstuvwxyzABCDEFGHJKLMNPQRTUVWXY', + // 验证码过期时间 + 'expire' => 1800, + // 是否使用中文验证码 + 'useZh' => false, + // 是否使用算术验证码 + 'math' => false, + // 是否使用背景图 + 'useImgBg' => false, + //验证码字符大小 + 'fontSize' => 25, + // 是否使用混淆曲线 + 'useCurve' => true, + //是否添加杂点 + 'useNoise' => true, + // 验证码字体 不设置则随机 + 'fontttf' => '', + //背景颜色 + 'bg' => [243, 251, 254], + // 验证码图片高度 + 'imageH' => 0, + // 验证码图片宽度 + 'imageW' => 0, + + // 添加额外的验证码设置 + // verify => [ + // 'length'=>4, + // ... + //], +]; diff --git a/vendor/topthink/think-multi-app/src/command/Build.php b/vendor/topthink/think-multi-app/src/command/Build.php new file mode 100644 index 0000000..e192167 --- /dev/null +++ b/vendor/topthink/think-multi-app/src/command/Build.php @@ -0,0 +1,180 @@ + +// +---------------------------------------------------------------------- + +namespace think\app\command; + +use think\console\Command; +use think\console\Input; +use think\console\input\Argument; +use think\console\Output; + +class Build extends Command +{ + /** + * 应用基础目录 + * @var string + */ + protected $basePath; + + /** + * {@inheritdoc} + */ + protected function configure() + { + $this->setName('build') + ->addArgument('app', Argument::OPTIONAL, 'app name .') + ->setDescription('Build App Dirs'); + } + + protected function execute(Input $input, Output $output) + { + $this->basePath = $this->app->getBasePath(); + $app = $input->getArgument('app') ?: ''; + + if (is_file($this->basePath . 'build.php')) { + $list = include $this->basePath . 'build.php'; + } else { + $list = [ + '__dir__' => ['controller', 'model', 'view'], + ]; + } + + $this->buildApp($app, $list); + $output->writeln("Successed"); + + } + + /** + * 创建应用 + * @access protected + * @param string $app 应用名 + * @param array $list 目录结构 + * @return void + */ + protected function buildApp(string $app, array $list = []): void + { + if (!is_dir($this->basePath . $app)) { + // 创建应用目录 + mkdir($this->basePath . $app); + } + + $appPath = $this->basePath . ($app ? $app . DIRECTORY_SEPARATOR : ''); + $namespace = 'app' . ($app ? '\\' . $app : ''); + + // 创建配置文件和公共文件 + $this->buildCommon($app); + // 创建模块的默认页面 + $this->buildHello($app, $namespace); + + foreach ($list as $path => $file) { + if ('__dir__' == $path) { + // 生成子目录 + foreach ($file as $dir) { + $this->checkDirBuild($appPath . $dir); + } + } elseif ('__file__' == $path) { + // 生成(空白)文件 + foreach ($file as $name) { + if (!is_file($appPath . $name)) { + file_put_contents($appPath . $name, 'php' == pathinfo($name, PATHINFO_EXTENSION) ? 'app->config->get('route.controller_suffix')) { + $filename = $appPath . $path . DIRECTORY_SEPARATOR . $val . 'Controller.php'; + $class = $val . 'Controller'; + } + $content = "checkDirBuild(dirname($filename)); + $content = ''; + break; + default: + // 其他文件 + $content = "app->config->get('route.controller_suffix') ? 'Controller' : ''; + $filename = $this->basePath . ($app ? $app . DIRECTORY_SEPARATOR : '') . 'controller' . DIRECTORY_SEPARATOR . 'Index' . $suffix . '.php'; + + if (!is_file($filename)) { + $content = file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . 'stubs' . DIRECTORY_SEPARATOR . 'controller.stub'); + $content = str_replace(['{%name%}', '{%app%}', '{%layer%}', '{%suffix%}'], [$app, $namespace, 'controller', $suffix], $content); + $this->checkDirBuild(dirname($filename)); + + file_put_contents($filename, $content); + } + } + + /** + * 创建应用的公共文件 + * @access protected + * @param string $app 目录 + * @return void + */ + protected function buildCommon(string $app): void + { + $appPath = $this->basePath . ($app ? $app . DIRECTORY_SEPARATOR : ''); + + if (!is_file($appPath . 'common.php')) { + file_put_contents($appPath . 'common.php', "queryStartTime = microtime(true); - $this->cursor = $this->mongo->executeQuery($namespace, $mongoQuery, $readPreference); + if ($session = $this->getSession()) { + $this->cursor = $this->mongo->executeQuery($namespace, $query, [ + 'readPreference' => is_null($readPreference) ? new ReadPreference(ReadPreference::RP_PRIMARY) : $readPreference, + 'session' => $session + ]); + } else { + $this->cursor = $this->mongo->executeQuery($namespace, $mongoQuery, $readPreference); + } // SQL监控 if (!empty($this->config['trigger_sql'])) { @@ -351,7 +361,14 @@ class Mongo extends Connection implements ConnectionInterface $writeConcern = $options['writeConcern'] ?? null; $this->queryStartTime = microtime(true); - $writeResult = $this->mongo->executeBulkWrite($namespace, $bulk, $writeConcern); + if ($session = $this->getSession()) { + $writeResult = $this->mongo->executeBulkWrite($namespace, $bulk, [ + 'session' => $session, + 'writeConcern' => is_null($writeConcern) ? new WriteConcern(1) : $writeConcern + ]); + } else { + $writeResult = $this->mongo->executeBulkWrite($namespace, $bulk, $writeConcern); + } // SQL监控 if (!empty($this->config['trigger_sql'])) { @@ -403,7 +420,14 @@ class Mongo extends Connection implements ConnectionInterface $this->queryStr = 'db.' . $this->queryStr; } - $this->cursor = $this->mongo->executeCommand($dbName, $command, $readPreference); + if ($session = $this->getSession()) { + $this->cursor = $this->mongo->executeCommand($dbName, $command, [ + 'readPreference' => is_null($readPreference) ? new ReadPreference(ReadPreference::RP_PRIMARY) : $readPreference, + 'session' => $session + ]); + } else { + $this->cursor = $this->mongo->executeCommand($dbName, $command, $readPreference); + } // SQL监控 if (!empty($this->config['trigger_sql'])) { @@ -1033,7 +1057,23 @@ class Mongo extends Connection implements ConnectionInterface * @throws \Throwable */ public function transaction(callable $callback) - {} + { + $this->startTrans(); + try { + $result = null; + if (is_callable($callback)) { + $result = call_user_func_array($callback, [$this]); + } + $this->commit(); + return $result; + } catch (\Exception $e) { + $this->rollback(); + throw $e; + } catch (\Throwable $e) { + $this->rollback(); + throw $e; + } + } /** * 启动事务 @@ -1043,7 +1083,13 @@ class Mongo extends Connection implements ConnectionInterface * @throws \Exception */ public function startTrans() - {} + { + $this->initConnect(true); + $this->session_uuid = uniqid(); + $this->sessions[$this->session_uuid] = $this->getMongo()->startSession(); + + $this->sessions[$this->session_uuid]->startTransaction([]); + } /** * 用于非自动提交状态下面的查询提交 @@ -1052,7 +1098,12 @@ class Mongo extends Connection implements ConnectionInterface * @throws PDOException */ public function commit() - {} + { + if ($session = $this->getSession()) { + $session->commitTransaction(); + $this->setLastSession(); + } + } /** * 事务回滚 @@ -1061,6 +1112,40 @@ class Mongo extends Connection implements ConnectionInterface * @throws PDOException */ public function rollback() - {} + { + if ($session = $this->getSession()) { + $session->abortTransaction(); + $this->setLastSession(); + } + } + /** + * 结束当前会话,设置上一个会话为当前会话 + * @author klinson + */ + protected function setLastSession() + { + if ($session = $this->getSession()) { + $session->endSession(); + unset($this->sessions[$this->session_uuid]); + if (empty($this->sessions)) { + $this->session_uuid = null; + } else { + end($this->sessions); + $this->session_uuid = key($this->sessions); + } + } + } + + /** + * 获取当前会话 + * @return \MongoDB\Driver\Session|null + * @author klinson + */ + public function getSession() + { + return ($this->session_uuid && isset($this->sessions[$this->session_uuid])) + ? $this->sessions[$this->session_uuid] + : null; + } } diff --git a/vendor/topthink/think-template/src/facade/Template.php b/vendor/topthink/think-template/src/facade/Template.php new file mode 100644 index 0000000..665a180 --- /dev/null +++ b/vendor/topthink/think-template/src/facade/Template.php @@ -0,0 +1,83 @@ + +// +---------------------------------------------------------------------- + +namespace think\facade; + +if (class_exists('think\Facade')) { + class Facade extends \think\Facade + {} +} else { + class Facade + { + /** + * 始终创建新的对象实例 + * @var bool + */ + protected static $alwaysNewInstance; + + protected static $instance; + + /** + * 获取当前Facade对应类名 + * @access protected + * @return string + */ + protected static function getFacadeClass() + {} + + /** + * 创建Facade实例 + * @static + * @access protected + * @return object + */ + protected static function createFacade() + { + $class = static::getFacadeClass() ?: 'think\Template'; + + if (static::$alwaysNewInstance) { + return new $class(); + } + + if (!self::$instance) { + self::$instance = new $class(); + } + + return self::$instance; + + } + + // 调用实际类的方法 + public static function __callStatic($method, $params) + { + return call_user_func_array([static::createFacade(), $method], $params); + } + } +} + +/** + * @see \think\Template + * @mixin \think\Template + */ +class Template extends Facade +{ + protected static $alwaysNewInstance = true; + + /** + * 获取当前Facade对应类名(或者已经绑定的容器对象标识) + * @access protected + * @return string + */ + protected static function getFacadeClass() + { + return 'think\Template'; + } +} diff --git a/view/README.md b/view/README.md new file mode 100644 index 0000000..360eb24 --- /dev/null +++ b/view/README.md @@ -0,0 +1 @@ +如果不使用模板,可以删除该目录 \ No newline at end of file diff --git a/view/admin/public/base.html b/view/admin/public/base.html index 14d9105..41999c1 100644 --- a/view/admin/public/base.html +++ b/view/admin/public/base.html @@ -2,7 +2,7 @@ - {block name="title"}通用后台管理模板系统{/block} + {block name="title"}TaoLer后台管理模板系统{/block} diff --git a/view/admin/public/header.html b/view/admin/public/header.html index b55fdf9..abb3863 100644 --- a/view/admin/public/header.html +++ b/view/admin/public/header.html @@ -63,10 +63,10 @@
  • - +
  • - +
  • \ No newline at end of file diff --git a/view/admin/slider/add.html b/view/admin/slider/add.html index 016ad58..4ed6413 100644 --- a/view/admin/slider/add.html +++ b/view/admin/slider/add.html @@ -10,10 +10,11 @@ @@ -22,6 +23,12 @@
    + +
    + +
    + +
    @@ -44,7 +51,7 @@
    - +
    diff --git a/view/admin/slider/edit.html b/view/admin/slider/edit.html index 84d823e..8c4a75a 100644 --- a/view/admin/slider/edit.html +++ b/view/admin/slider/edit.html @@ -9,10 +9,11 @@
    @@ -22,32 +23,34 @@ - +
    + +
    + +
    +
    -
    -
    -
    - +
    diff --git a/view/admin/slider/index.html b/view/admin/slider/index.html index 8b7db60..f6b1517 100644 --- a/view/admin/slider/index.html +++ b/view/admin/slider/index.html @@ -21,6 +21,7 @@ 图片 位置 路径 + 颜色 开始 结束 状态 @@ -32,9 +33,10 @@ {$vo.id} {$vo.slid_name} - + {if condition="$vo.slid_img != ''"}{/if} {$vo.slid_type} {$vo.slid_href} + {$vo.slid_color} {$vo.slid_start|date='Y-m-d'} {$vo.slid_over|date='Y-m-d'} {$vo.slid_status ?'显示':'禁止'} @@ -81,7 +83,7 @@ layui.use(['layer','table','form','upload','laydate'], function(){ $('#slid-add').on('click', function(){ layer.open({ type: 2, - title: '添加幻灯', + title: '添加广告', content: 'add.html', maxmin: true, area : ['500px' , '450px'], @@ -99,8 +101,8 @@ layui.use(['layer','table','form','upload','laydate'], function(){ //提交 Ajax 成功后,静态更新表格中的数据 $.ajax({ type:"post", - url:"{:url('admin/user/add')}", - data:{"slid_type":field.slid_type,"slid_name":field.slid_name,"slid_start":field.slid_start,"slid_over":field.slid_over,"slid_href":field.slid_href,"slid_img":field.slid_img}, + url:"{:url('admin/slider/add')}", + data:{"slid_type":field.slid_type,"slid_name":field.slid_name,"slid_color":field.slid_color,"slid_start":field.slid_start,"slid_over":field.slid_over,"slid_href":field.slid_href,"slid_img":field.slid_img}, daType:"json", success:function (data){ if (data.code == 1) { @@ -126,7 +128,7 @@ layui.use(['layer','table','form','upload','laydate'], function(){ } }); }); - //编辑幻灯 + //编辑广告 $('a[lay-event=edit]').on('click', function(){ var id = $(this).attr('id-data'); layer.open({ @@ -150,7 +152,7 @@ layui.use(['layer','table','form','upload','laydate'], function(){ $.ajax({ type:"post", url:"{:url('admin/slider/edit')}", - data:{"id":id,"slid_type":field.slid_type,"slid_name":field.slid_name,"slid_start":field.slid_start,"slid_over":field.slid_over,"slid_href":field.slid_href,"slid_img":field.slid_img}, + data:{"id":id,"slid_type":field.slid_type,"slid_name":field.slid_name,"slid_color":field.slid_color,"slid_start":field.slid_start,"slid_over":field.slid_over,"slid_href":field.slid_href,"slid_img":field.slid_img}, daType:"json", success:function (data){ if (data.code == 1) { diff --git a/view/index/article/cate.html b/view/index/article/cate.html index d2dfa5a..86c2268 100644 --- a/view/index/article/cate.html +++ b/view/index/article/cate.html @@ -74,7 +74,7 @@
    {volist name="ad_cate" id="vo"} - {$vo.slid_name} + {$vo.slid_name} {/volist}
    diff --git a/view/index/article/detail.html b/view/index/article/detail.html index d15f9bd..0071ac8 100644 --- a/view/index/article/detail.html +++ b/view/index/article/detail.html @@ -196,9 +196,7 @@
    {volist name="ad_art" id="vo"} - - CODING - + {$vo.slid_name} {/volist}
    diff --git a/view/index/index/index.html b/view/index/index/index.html index 24b34c5..d46869f 100644 --- a/view/index/index/index.html +++ b/view/index/index/index.html @@ -50,8 +50,8 @@ {$top.create_time|date='Y-m-d'} - 已结 + {$top.comments_count} @@ -74,11 +74,9 @@
      {volist name="artList" id="art"}
    • - {$art.user.name} -

      {$art.cate.catename} {$art.title} @@ -121,16 +119,16 @@
      @@ -158,7 +156,6 @@ 已签到状态 获得了20飞吻 -
      --> @@ -168,7 +165,7 @@
      {volist name="ad_index" id="vo"} - {$vo.slid_name} + {$vo.slid_name} {/volist}
      @@ -334,7 +331,7 @@ $('#friend-link').on('click', function(){ layer.open({ title: '申请友链', - content: '发送邮件至:xx.com ', + content: '发送邮件至:changlin_zhao@qq.com ', yes: function(index, layero){ layer.close(index); } diff --git a/view/index/login/login.html b/view/index/login/login.html index 3de6433..d6b31ee 100644 --- a/view/index/login/login.html +++ b/view/index/login/login.html @@ -41,11 +41,11 @@ 忘记密码? -
      +
      diff --git a/view/index/public/filter.html b/view/index/public/filter.html index c9bc245..fd9fd99 100644 --- a/view/index/public/filter.html +++ b/view/index/public/filter.html @@ -6,10 +6,10 @@ 精华 - + diff --git a/view/index/public/flink.html b/view/index/public/flink.html index 706bc40..8ab4d83 100644 --- a/view/index/public/flink.html +++ b/view/index/public/flink.html @@ -2,7 +2,7 @@

      友情链接

      {volist name="flinks" id="vo"} -
      {$vo.linkname}
      +
      {$vo.slid_name}
      {/volist}
      申请友链
      diff --git a/view/index/public/header.html b/view/index/public/header.html index 57cfc91..e288c43 100644 --- a/view/index/public/header.html +++ b/view/index/public/header.html @@ -52,12 +52,12 @@
    • 注册
    • -
    • + {/if}
    diff --git a/view/index/public/user-nav.html b/view/index/public/user-nav.html index c2943e8..cbc3804 100644 --- a/view/index/public/user-nav.html +++ b/view/index/public/user-nav.html @@ -23,18 +23,12 @@ 我的消息 -
  • - - - 我的授权 - -
  • - +
    diff --git a/view/install/index/agreement.html b/view/install/index/agreement.html index b54ad14..fa5e29b 100644 --- a/view/install/index/agreement.html +++ b/view/install/index/agreement.html @@ -10,7 +10,7 @@

    4、尽管程序在发布前已经过安全测试,但仍不能完全保证漏洞的存在和丢失数据的风险,作者不承担商业风险。

    5、本程序版权归开发者所有,在未经过作者同意的情况下,严禁转售、赠送他人。

    6、您可以在完全遵守本许可协议的基础上,免费下载安装使用,商业应用请联系作者授权。

    -

    7、无论您是个人或组织、盈利与否、用途如何(包括以学习和研究为目的),均需仔细阅读本协议,包括免除或者限制开发团队责任的免责条款及对您的权利限制。请您审阅并接受或不接受本服务条款。如您不同意本服务条款及/或随时对其的修改,您应不使用或主动取消产品。否则,您的任何对产品中的相关服务的注册、登陆、下载、查看等使用行为将被视为您对本服务条款全部的完全接受,包括接受对服务条款随时所做的任何修改。

    +

    7、无论您是个人或组织、盈利与否、用途如何(包括以学习和研究为目的),均需仔细阅读本协议,包括免除或者限制开发团队责任的免责条款及对您的权利限制。请您审阅并接受或不接受本服务条款。如您不同意本服务条款及/或LaySNS开发团队随时对其的修改,您应不使用或主动取消产品。否则,您的任何对产品中的相关服务的注册、登陆、下载、查看等使用行为将被视为您对本服务条款全部的完全接受,包括接受对服务条款随时所做的任何修改。

    8、本协议一旦发生变更, Tao社区开发团队将在网页上公布修改内容。修改后的服务条款一旦在网站管理后台上公布即有效代替原来的服务条款。如果您选择接受本条款,即表示您同意接受协议各项条件的约束。如果您不同意本服务条款,则不能获得使用本服务的权利。您若有违反本条款规定,TaoLer有权随时中止或终止您对本程序的使用资格并保留追究相关法律责任的权利。

    9、在理解、同意、并遵守本协议的全部条款后,方可开始使用本程序。本许可协议条款的解释,效力及纠纷的解决,适用于中华人民共和国大陆法律。

    10、您使用本系统,需要遵循许可协议,一旦安装表示您已接受该系统各项条款。

    diff --git a/view/install/index/test.html b/view/install/index/test.html index e741dd0..9da90fe 100644 --- a/view/install/index/test.html +++ b/view/install/index/test.html @@ -83,7 +83,6 @@ -
    上一步 @@ -98,7 +97,7 @@ if ($('.yes').length != 5) { alert('您的配置或权限不符合要求'); } else { - location.href = '/install/index/create'; + location.href = '{:url('install/index/create')}'; } }