lzj500 vor 3 Jahren
Ursprung
Commit
7fb74edca4
55 geänderte Dateien mit 3511 neuen und 0 gelöschten Zeilen
  1. 1 0
      thinkphp6/.env
  2. 4 0
      thinkphp6/.gitignore
  3. 42 0
      thinkphp6/.travis.yml
  4. 32 0
      thinkphp6/LICENSE.txt
  5. 52 0
      thinkphp6/README.md
  6. 1 0
      thinkphp6/app/.htaccess
  7. 22 0
      thinkphp6/app/AppService.php
  8. 94 0
      thinkphp6/app/BaseController.php
  9. 58 0
      thinkphp6/app/ExceptionHandle.php
  10. 8 0
      thinkphp6/app/Request.php
  11. 70 0
      thinkphp6/app/common.php
  12. 48 0
      thinkphp6/app/common/ErrorCode.php
  13. 129 0
      thinkphp6/app/common/controller/Base.php
  14. 18 0
      thinkphp6/app/common/model/Base.php
  15. 100 0
      thinkphp6/app/common/model/Demo.php
  16. 135 0
      thinkphp6/app/common/util/Rsa.php
  17. 59 0
      thinkphp6/app/common/util/SingleObjectClass.php
  18. 17 0
      thinkphp6/app/event.php
  19. 36 0
      thinkphp6/app/index/ErrorCode.php
  20. 49 0
      thinkphp6/app/index/controller/Base.php
  21. 59 0
      thinkphp6/app/index/controller/Demo.php
  22. 68 0
      thinkphp6/app/index/controller/Excel.php
  23. 42 0
      thinkphp6/app/index/controller/Index.php
  24. 10 0
      thinkphp6/app/middleware.php
  25. 9 0
      thinkphp6/app/provider.php
  26. 9 0
      thinkphp6/app/service.php
  27. 50 0
      thinkphp6/composer.json
  28. 1780 0
      thinkphp6/composer.lock
  29. 34 0
      thinkphp6/config/app.php
  30. 29 0
      thinkphp6/config/cache.php
  31. 4 0
      thinkphp6/config/common.php
  32. 9 0
      thinkphp6/config/console.php
  33. 18 0
      thinkphp6/config/cookie.php
  34. 62 0
      thinkphp6/config/database.php
  35. 24 0
      thinkphp6/config/filesystem.php
  36. 25 0
      thinkphp6/config/lang.php
  37. 45 0
      thinkphp6/config/log.php
  38. 8 0
      thinkphp6/config/middleware.php
  39. 45 0
      thinkphp6/config/route.php
  40. 19 0
      thinkphp6/config/session.php
  41. 10 0
      thinkphp6/config/trace.php
  42. 25 0
      thinkphp6/config/view.php
  43. 53 0
      thinkphp6/demo.sql
  44. 2 0
      thinkphp6/extend/.gitignore
  45. 8 0
      thinkphp6/public/.htaccess
  46. BIN
      thinkphp6/public/excel/rhasd211027.xlsx
  47. BIN
      thinkphp6/public/favicon.ico
  48. 37 0
      thinkphp6/public/index.php
  49. 2 0
      thinkphp6/public/robots.txt
  50. 19 0
      thinkphp6/public/router.php
  51. 2 0
      thinkphp6/public/static/.gitignore
  52. 17 0
      thinkphp6/route/app.php
  53. 10 0
      thinkphp6/think
  54. 1 0
      thinkphp6/view/README.md
  55. 1 0
      thinkphp6/首次使用说明.txt

+ 1 - 0
thinkphp6/.env

@@ -0,0 +1 @@
+APP_DEBUG = true

[APP]
DEFAULT_TIMEZONE = Asia/Shanghai

[DATABASE]
TYPE = mysql
HOSTNAME = 127.0.0.1
DATABASE = demo
USERNAME = root
PASSWORD = root
HOSTPORT = 3306
CHARSET = utf8
DEBUG = true

[LANG]
default_lang = zh-cn

+ 4 - 0
thinkphp6/.gitignore

@@ -0,0 +1,4 @@
+/.idea
+/.vscode
+/vendor
+*.log

Datei-Diff unterdrückt, da er zu groß ist
+ 42 - 0
thinkphp6/.travis.yml


+ 32 - 0
thinkphp6/LICENSE.txt

@@ -0,0 +1,32 @@
+
+ThinkPHP遵循Apache2开源协议发布,并提供免费使用。
+版权所有Copyright © 2006-2016 by ThinkPHP (http://thinkphp.cn)
+All rights reserved。
+ThinkPHP® 商标和著作权所有者为上海顶想信息科技有限公司。
+
+Apache Licence是著名的非盈利开源组织Apache采用的协议。
+该协议和BSD类似,鼓励代码共享和尊重原作者的著作权,
+允许代码修改,再作为开源或商业软件发布。需要满足
+的条件: 
+1. 需要给代码的用户一份Apache Licence ;
+2. 如果你修改了代码,需要在被修改的文件中说明;
+3. 在延伸的代码中(修改和有源代码衍生的代码中)需要
+带有原来代码中的协议,商标,专利声明和其他原来作者规
+定需要包含的说明;
+4. 如果再发布的产品中包含一个Notice文件,则在Notice文
+件中需要带有本协议内容。你可以在Notice中增加自己的
+许可,但不可以表现为对Apache Licence构成更改。 
+具体的协议参考:http://www.apache.org/licenses/LICENSE-2.0
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.

+ 52 - 0
thinkphp6/README.md

@@ -0,0 +1,52 @@
+ThinkPHP 6.0
+===============
+
+> 运行环境要求PHP7.1+。
+
+## 主要新特性
+
+* 采用`PHP7`强类型(严格模式)
+* 支持更多的`PSR`规范
+* 原生多应用支持
+* 更强大和易用的查询
+* 全新的事件系统
+* 模型事件和数据库事件统一纳入事件系统
+* 模板引擎分离出核心
+* 内部功能中间件化
+* SESSION/Cookie机制改进
+* 对Swoole以及协程支持改进
+* 对IDE更加友好
+* 统一和精简大量用法
+
+## 安装
+
+~~~
+composer create-project topthink/think tp 6.0.*
+~~~
+
+如果需要更新框架使用
+~~~
+composer update topthink/framework
+~~~
+
+## 文档
+
+[完全开发手册](https://www.kancloud.cn/manual/thinkphp6_0/content)
+
+## 参与开发
+
+请参阅 [ThinkPHP 核心框架包](https://github.com/top-think/framework)。
+
+## 版权信息
+
+ThinkPHP遵循Apache2开源协议发布,并提供免费使用。
+
+本项目包含的第三方源码和二进制文件之版权信息另行标注。
+
+版权所有Copyright © 2006-2020 by ThinkPHP (http://thinkphp.cn)
+
+All rights reserved。
+
+ThinkPHP® 商标和著作权所有者为上海顶想信息科技有限公司。
+
+更多细节参阅 [LICENSE.txt](LICENSE.txt)

+ 1 - 0
thinkphp6/app/.htaccess

@@ -0,0 +1 @@
+deny from all

+ 22 - 0
thinkphp6/app/AppService.php

@@ -0,0 +1,22 @@
+<?php
+declare (strict_types = 1);
+
+namespace app;
+
+use think\Service;
+
+/**
+ * 应用服务类
+ */
+class AppService extends Service
+{
+    public function register()
+    {
+        // 服务注册
+    }
+
+    public function boot()
+    {
+        // 服务启动
+    }
+}

+ 94 - 0
thinkphp6/app/BaseController.php

@@ -0,0 +1,94 @@
+<?php
+declare (strict_types = 1);
+
+namespace app;
+
+use think\App;
+use think\exception\ValidateException;
+use think\Validate;
+
+/**
+ * 控制器基础类
+ */
+abstract class BaseController
+{
+    /**
+     * Request实例
+     * @var \think\Request
+     */
+    protected $request;
+
+    /**
+     * 应用实例
+     * @var \think\App
+     */
+    protected $app;
+
+    /**
+     * 是否批量验证
+     * @var bool
+     */
+    protected $batchValidate = false;
+
+    /**
+     * 控制器中间件
+     * @var array
+     */
+    protected $middleware = [];
+
+    /**
+     * 构造方法
+     * @access public
+     * @param  App  $app  应用对象
+     */
+    public function __construct(App $app)
+    {
+        $this->app     = $app;
+        $this->request = $this->app->request;
+
+        // 控制器初始化
+        $this->initialize();
+    }
+
+    // 初始化
+    protected function initialize()
+    {}
+
+    /**
+     * 验证数据
+     * @access protected
+     * @param  array        $data     数据
+     * @param  string|array $validate 验证器名或者验证规则数组
+     * @param  array        $message  提示信息
+     * @param  bool         $batch    是否批量验证
+     * @return array|string|true
+     * @throws ValidateException
+     */
+    protected function validate(array $data, $validate, array $message = [], bool $batch = false)
+    {
+        if (is_array($validate)) {
+            $v = new Validate();
+            $v->rule($validate);
+        } else {
+            if (strpos($validate, '.')) {
+                // 支持场景
+                [$validate, $scene] = explode('.', $validate);
+            }
+            $class = false !== strpos($validate, '\\') ? $validate : $this->app->parseClass('validate', $validate);
+            $v     = new $class();
+            if (!empty($scene)) {
+                $v->scene($scene);
+            }
+        }
+
+        $v->message($message);
+
+        // 是否批量验证
+        if ($batch || $this->batchValidate) {
+            $v->batch(true);
+        }
+
+        return $v->failException(true)->check($data);
+    }
+
+}

+ 58 - 0
thinkphp6/app/ExceptionHandle.php

@@ -0,0 +1,58 @@
+<?php
+namespace app;
+
+use think\db\exception\DataNotFoundException;
+use think\db\exception\ModelNotFoundException;
+use think\exception\Handle;
+use think\exception\HttpException;
+use think\exception\HttpResponseException;
+use think\exception\ValidateException;
+use think\Response;
+use Throwable;
+
+/**
+ * 应用异常处理类
+ */
+class ExceptionHandle extends Handle
+{
+    /**
+     * 不需要记录信息(日志)的异常类列表
+     * @var array
+     */
+    protected $ignoreReport = [
+        HttpException::class,
+        HttpResponseException::class,
+        ModelNotFoundException::class,
+        DataNotFoundException::class,
+        ValidateException::class,
+    ];
+
+    /**
+     * 记录异常信息(包括日志或者其它方式记录)
+     *
+     * @access public
+     * @param  Throwable $exception
+     * @return void
+     */
+    public function report(Throwable $exception): void
+    {
+        // 使用内置的方式记录异常日志
+        parent::report($exception);
+    }
+
+    /**
+     * Render an exception into an HTTP response.
+     *
+     * @access public
+     * @param \think\Request   $request
+     * @param Throwable $e
+     * @return Response
+     */
+    public function render($request, Throwable $e): Response
+    {
+        // 添加自定义异常处理机制
+
+        // 其他错误交给系统处理
+        return parent::render($request, $e);
+    }
+}

+ 8 - 0
thinkphp6/app/Request.php

@@ -0,0 +1,8 @@
+<?php
+namespace app;
+
+// 应用请求对象类
+class Request extends \think\Request
+{
+
+}

+ 70 - 0
thinkphp6/app/common.php

@@ -0,0 +1,70 @@
+<?php
+// 应用公共文件
+
+
+if (!function_exists('getSiteUrl')) {
+    /**
+     * 获取当前站点的访问路径根目录
+     * @return [type] [description]
+     */
+    function getSiteUrl()
+    {
+        $uri = $_SERVER['REQUEST_URI'] ? $_SERVER['REQUEST_URI'] : ($_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME']);
+        return 'http://' . $_SERVER['HTTP_HOST'] . substr($uri, 0, strrpos($uri, '/') + 1);
+    }
+}
+if (!function_exists('getVirRootDir')) {
+    /**
+     * 获取虚拟目录路径
+     * @return bool|string
+     */
+    function getVirRootDir()
+    {
+        $url = $_SERVER['SCRIPT_NAME'];
+        $url = substr($url, 0, strripos($url, "/"));
+        return $url;
+    }
+}
+
+if (!function_exists('returnFormat')) {
+    /**
+     * 格式化输出返回值
+     * @param int $code
+     * @param string $msg
+     * @param array $data
+     * @return mixed
+     */
+    function returnFormat($code = 0, $msg = "", $data = [])
+    {
+        $res['code'] = $code;
+        $res['data'] = $data;
+        $res['msg'] = $msg;
+        return $res;
+    }
+}
+
+
+if (!function_exists('getNow')) {
+    /**
+     * 获取当时时间
+     * @param string $fmt 格式化
+     * @return false|string
+     */
+    function getNow($fmt = "Y-m-d H:i:s")
+    {
+        return date($fmt);
+    }
+}
+
+if (!function_exists('writeln')) {
+    /**
+     * 获取当时时间
+     * @param string $fmt 格式化
+     * @return false|string
+     */
+    function writeln($str)
+    {
+        echo print_r($str,true) . PHP_EOL;
+        echo "<br/>" . PHP_EOL;
+    }
+}

+ 48 - 0
thinkphp6/app/common/ErrorCode.php

@@ -0,0 +1,48 @@
+<?php
+/**
+ * Created by PhpStorm.
+ * User: yckj_lzj
+ * Date: 2019-08-22
+ * Time: 14:51
+ */
+
+namespace app\common;
+
+
+/**
+ * 错误码
+ * Class ErrorCode
+ * @package app\api
+ */
+class ErrorCode
+{
+    /**
+     * 返回错误代内容
+     * @param $code
+     * @return mixed
+     */
+    public static function getError($code)
+    {
+        $errArr = self::getErrorArr();
+        if(!key_exists($code,$errArr)){
+            return "未知错误";
+        }
+        return $errArr[$code];
+    }
+
+    /**
+     * 获取错误码数组
+     * @return array
+     */
+    protected static function getErrorArr()
+    {
+        return [
+            "0" => "成功",
+            "9001" => "缺少签名",
+            "9002" => "签名不正确",
+            "9004" => "请求已过期",
+            "9999" => "系统错误",
+
+        ];
+    }
+}

+ 129 - 0
thinkphp6/app/common/controller/Base.php

@@ -0,0 +1,129 @@
+<?php
+
+
+namespace app\common\controller;
+
+use app\common\ErrorCode;
+use think\exception\HttpResponseException;
+use think\exception\ValidateException;
+use think\facade\Log;
+use think\Response;
+
+/**
+ * 控制器基类
+ * Class Base
+ * @package app\common\controller
+ */
+class Base
+{
+    protected $debug=false;//是否启用调试模式
+    protected $checkSignOpen = false;//是否校验签名,true校验,false不校验
+    //=== begin 处理跨域====
+    /**
+     * 构造函数,处理跨域
+     * Base constructor
+     */
+    public function __construct()
+    {
+
+        if ($this->catchOptions()) {
+            die("this is option");
+        }
+        //启用调试模式
+
+    }
+
+
+    protected function catchOptions()
+    {
+        $request = request();
+        return $request->method() == "OPTIONS";
+    }
+    //===end 处理跨域====
+
+    /**
+     * 成功返回内容
+     * @param $data
+     * @param string $msg
+     * @param int $code
+     */
+    public function success($data,$msg="",$code=0)
+    {
+        if($msg==""){
+            $msg=ErrorCode::getError($code);
+        }
+        $response = returnFormat($code, $msg, $data);
+
+        Log::record(json_encode($response, JSON_UNESCAPED_UNICODE), "response");
+
+        throw new HttpResponseException(Response::create($response, "json"));
+    }
+
+
+    /**
+     * 失败返回内容
+     * @param int $code
+     * @param null $data
+     */
+    public function error($code = 9999,$msg="", $data = null)
+    {
+        if($msg==""){
+            $msg=ErrorCode::getError($code);
+        }
+
+        if ($data === null) {
+            $data = new \stdClass();
+        }
+        $response = returnFormat($code, $msg, $data);
+        Log::record(json_encode($response, JSON_UNESCAPED_UNICODE), "response");
+        throw new HttpResponseException(Response::create($response, "json"));
+    }
+
+    /**
+     * 自动校验
+     * @param $class
+     * @param $param
+     */
+    protected function autoValid($class, $param)
+    {
+        try {
+            validate($class)->check($param);
+        } catch (ValidateException $e) {
+            // 验证失败 输出错误信息
+            return returnFormat(999,$e->getError());
+            //$this->error($e->getError());
+        }
+        return returnFormat(0);
+    }
+    /**
+     * 接口签名校验
+     */
+    protected function checkApiSign()
+    {
+        $param = request()->param();
+
+        $validRes= $this->autoValid([
+            "_timestamp" => "require",
+            "_sign" => "require",
+        ], $param);
+        if($validRes['code']!==0){
+            return $validRes;
+        }
+        $effectMinute=2;//有效时间,分钟数
+        if (!($param["_timestamp"] >= time() - $effectMinute * 60 && $param["_timestamp"] <= time() + $effectMinute * 60)) {
+            return returnFormat(9004);
+        }
+        $sign = $param["_sign"];
+        unset($param["_sign"]);//删除原签名字段,用来重新生成签名
+        ksort($param);
+        $secret = config("common.api_sign_secret");
+
+        $sign2 = md5(json_encode($param, JSON_UNESCAPED_UNICODE) . $secret);
+        if ($sign !== $sign2) {
+            return returnFormat(9002," $secret 原签名:$sign 新签名:$sign2 ");
+        }
+        return returnFormat(0);
+    }
+
+
+}

+ 18 - 0
thinkphp6/app/common/model/Base.php

@@ -0,0 +1,18 @@
+<?php
+/**
+ * Created by PhpStorm.
+ * User: dengjq
+ * Date: 2019/1/24
+ * Time: 14:59
+ */
+
+namespace app\common\model;
+
+
+use think\Model;
+use think\model\concern\SoftDelete;
+
+abstract class Base extends Model
+{
+
+}

+ 100 - 0
thinkphp6/app/common/model/Demo.php

@@ -0,0 +1,100 @@
+<?php
+/**
+ * Created by PhpStorm.
+ * User: yckj_lzj
+ * Date: 2020-05-21
+ * Time: 11:28
+ */
+
+namespace app\common\model;
+
+use think\Model;
+use think\model\concern\SoftDelete;
+
+/**
+ * 演示模型
+ * Class Demo
+ * @package app\common\model
+ */
+class Demo extends Model
+{
+    use SoftDelete;
+//    protected $deleteTime = 'delete_time';
+//    protected $defaultSoftDelete = 1;
+
+    /**
+     * 获取列表,自带分页功能
+     * @return mixed
+     * @throws \think\db\exception\DbException
+     */
+    public function getList()
+    {
+        $where=[];
+        $keyword=input("title");
+        if($keyword){
+            $where[]=array("title","like","%".$keyword."%");
+        }else{
+//            return returnFormat(9999,"请输入关键词");//模拟报错,上线时要注释
+        }
+        $orderby=input("orderby",$this->getPk()." desc");
+        $page_size=input("page_size",10);//分页大小
+        $list=self::where($where)->order($orderby)->paginate($page_size);
+        return returnFormat(0,'查询成功',$list);
+    }
+
+    public function add()
+    {
+
+        $param = input('param.');
+        $param['update_time'] = $param['create_time'] = getNow();
+        $res=self::insert($param);
+        if($res===false){
+            return returnFormat(9999,'服务器错误,新增失败');
+        }
+        return returnFormat(0,'添加成功');
+    }
+
+    public function detail(){
+        $id=input("id");
+        if(!$id){
+            return returnFormat(9999,'缺少参数');
+        }
+        $where['id']=$id;
+        $model=self::where($where)->find();
+        if(!$model){
+            return returnFormat(9999,'未找到记录');
+        }
+        return returnFormat(0,'',$model->toArray());
+    }
+
+    public function del(){
+        $id=input("id");
+        $where["id"]=$id;
+        $res=self::where($where)->delete();
+        if($res===false){
+            return returnFormat(9999,'服务器错误');
+        }
+        return returnFormat(0,'删除成功');
+    }
+
+    public function edit(){
+        $id=input("id");
+        if(!$id){
+            return returnFormat(9999,'缺少参数');
+        }
+        $where["id"]=$id;
+        $model=self::where($where)->find();
+        if(!$model){
+            return returnFormat(9999,'未找到记录');
+        }
+        $param=input("param.");
+        $param["id"]=$id;
+        $res=self::update($param);
+        if($res===false){
+            return returnFormat(9999,'服务器错误');
+        }
+        return returnFormat(0,'修改成功');
+    }
+
+
+}

+ 135 - 0
thinkphp6/app/common/util/Rsa.php

@@ -0,0 +1,135 @@
+<?php
+/**
+ * Created by PhpStorm.
+ * User: yckj_lzj
+ * Date: 2019-10-22
+ * Time: 19:27
+ */
+
+namespace app\common\util;
+
+
+class Rsa extends SingleObjectClass
+{
+    protected $priKeyStr;
+    protected $pubKeyStr;
+
+    public  function setPriPubKey($pubKey,$priKey){
+        $this->priKeyStr=$priKey;
+        $this->pubKeyStr=$pubKey;
+//        $this->$pubKeyStr=$pubKey;
+    }
+
+    public function setPriKey($priKey){
+        $this->priKeyStr=$priKey;
+    }
+
+    public function setPubKey($pubKey){
+        $this->pubKeyStr=$pubKey;
+    }
+
+    private  function getPriKeyStr()
+    {
+        return "-----BEGIN PRIVATE KEY-----\n".$this->priKeyStr."\n-----END PRIVATE KEY-----";
+    }
+
+    public  function getPubKeyStr(){
+        return "-----BEGIN PUBLIC KEY-----\n".$this->pubKeyStr."\n-----END PUBLIC KEY-----";
+    }
+
+
+    /**
+     * 获取公钥     *
+     * @return bool|resource
+     */
+    private  function getPublicKey()
+    {
+
+
+        $content = $this->getPubKeyStr();
+
+        return openssl_pkey_get_public($content);
+    }
+
+    /**
+     * 获取私钥
+     * @return bool|resource
+     */
+    private  function getPrivateKey()
+    {
+
+        $content = $this->getPriKeyStr();
+//        echo $content;
+        return openssl_pkey_get_private($content);
+    }
+
+
+    /**
+     * 私钥加密
+     * @param $signString
+     * @return string
+     */
+    public  function priSign($signString){
+        $privKeyId = $this->getPrivateKey();
+        $signature = '';
+        openssl_sign($signString, $signature, $privKeyId);
+        openssl_free_key($privKeyId);
+        return base64_encode($signature);
+
+    }
+
+
+    /**
+     * 私钥加密
+     * @param string $data
+     * @return null|string
+     */
+    public  function privEncrypt($data = '')
+    {
+
+        if (!is_string($data)) {
+            return null;
+        }
+        return openssl_private_encrypt($data, $encrypted, $this->getPrivateKey()) ? base64_encode($encrypted) : null;
+    }
+
+    /**
+     * 公钥加密
+     * @param string $data
+     * @return null|string
+     */
+    public  function publicEncrypt($data = '')
+    {
+        if (!is_string($data)) {
+            return null;
+        }
+//        var_dump($this->getPublicKey());
+        return openssl_public_encrypt($data, $encrypted, $this->getPublicKey()) ? base64_encode($encrypted) : null;
+    }
+
+    /**
+     * 私钥解密
+     * @param string $encrypted
+     * @return null
+     */
+    public  function privDecrypt($encrypted = '')
+    {
+        if (!is_string($encrypted)) {
+            return null;
+        }
+        return (openssl_private_decrypt(base64_decode($encrypted), $decrypted, $this->getPrivateKey())) ? $decrypted : null;
+    }
+
+    /**
+     * 公钥解密
+     * @param string $encrypted
+     * @return null
+     */
+    public  function publicDecrypt($encrypted = '')
+    {
+        if (!is_string($encrypted)) {
+            return null;
+        }
+        return (openssl_public_decrypt(base64_decode($encrypted), $decrypted, $this->getPublicKey())) ? $decrypted : null;
+    }
+}

+ 59 - 0
thinkphp6/app/common/util/SingleObjectClass.php

@@ -0,0 +1,59 @@
+<?php
+/**
+ * Created by PhpStorm.
+ * User: yckj_lzj
+ * Date: 2019-08-21
+ * Time: 16:38
+ */
+
+namespace app\common\util;
+
+
+use think\Log;
+
+class SingleObjectClass
+{
+    protected $openLog=true;
+    //输出结果
+    protected function writeln($info, $type = "debug")
+    {
+        if ($this->openLog) {
+            Log::write(print_r($info, true), $type);
+        }
+    }
+
+    /**
+     * 返回内容
+     * @param $code
+     * @param $data
+     */
+    protected function getResult($code, $data = null)
+    {
+        $result['code'] = $code;
+        $result['msg'] = ActQuestionErrCode::$errInfo[$code];
+        if ($data) {
+            $result['data'] = $data;
+        }
+        return $result;
+    }
+
+    /**
+     * 类实例化(单例模式)
+     */
+    public static function instance()
+    {
+        static $_instance = array();
+
+        $classFullName = get_called_class();
+        if (!isset($_instance[$classFullName])) {
+            // $_instance[$classFullName] = new $classFullName();
+            // 1、先前这样写的话,PhpStrom 代码提示功能失效;
+            // 2、并且中间变量不能是 数组,如 不能用 return $_instance[$classFullName] 形式返回实例对象,否则 PhpStrom 代码提示功能失效;
+            $instance = $_instance[$classFullName] = new static();
+            return $instance;
+        }
+
+        return $_instance[$classFullName];
+    }
+
+}

+ 17 - 0
thinkphp6/app/event.php

@@ -0,0 +1,17 @@
+<?php
+// 事件定义文件
+return [
+    'bind'      => [
+    ],
+
+    'listen'    => [
+        'AppInit'  => [],
+        'HttpRun'  => [],
+        'HttpEnd'  => [],
+        'LogLevel' => [],
+        'LogWrite' => [],
+    ],
+
+    'subscribe' => [
+    ],
+];

+ 36 - 0
thinkphp6/app/index/ErrorCode.php

@@ -0,0 +1,36 @@
+<?php
+/**
+ * Created by PhpStorm.
+ * User: yckj_lzj
+ * Date: 2019-08-22
+ * Time: 14:51
+ */
+
+namespace app\index;
+
+
+/**
+ * 错误码
+ * Class ErrorCode
+ * @package app\api
+ */
+class ErrorCode extends \app\common\ErrorCode
+{
+
+
+    /**
+     * 获取错误码数组
+     * @return array
+     */
+    protected static function getErrorArr()
+    {
+        return [
+            "0" => "成功",
+            "9001" => "缺少签名",
+            "9002" => "签名不正确",
+            "9004" => "请求已过期",
+            "9999" => "系统错误",
+
+        ];
+    }
+}

+ 49 - 0
thinkphp6/app/index/controller/Base.php

@@ -0,0 +1,49 @@
+<?php
+/**
+ * Created by PhpStorm.
+ * User: yckj_lzj
+ * Date: 2020-05-21
+ * Time: 11:45
+ */
+
+namespace app\index\controller;
+
+
+use app\index\ErrorCode;
+use think\exception\HttpResponseException;
+use think\exception\ValidateException;
+use think\facade\Log;
+use think\Response;
+
+/**
+ * 控制器基类,所有控制器要继承
+ * Class Base
+ * @package app\index\controller
+ */
+class Base extends \app\common\controller\Base
+{
+    private $apikey = "32a1ff74699ff2d6ce4c497cb94cb5c8";//密钥
+
+
+    /**
+     * 构造函数
+     * Base constructor.
+     */
+    public function __construct()
+    {
+        parent::__construct();//继承父类构造函数
+        $this->checkSignOpen=true;
+        if ($this->checkSignOpen) {
+           $checkRes=$this->checkApiSign();
+           if($checkRes['code']!==0){
+               //如果签名校验未通过
+               $msg=$checkRes['msg']?$checkRes['msg']:ErrorCode::getError($checkRes['code']);
+               $this->error($checkRes['code'],$msg);
+           }
+        }
+    }
+
+
+
+
+}

+ 59 - 0
thinkphp6/app/index/controller/Demo.php

@@ -0,0 +1,59 @@
+<?php
+/**
+ * Created by PhpStorm.
+ * User: yckj_lzj
+ * Date: 2020-05-21
+ * Time: 11:45
+ */
+
+namespace app\index\controller;
+
+
+class Demo extends Base
+{
+    public function index(){
+        $demoM=new \app\common\model\Demo();
+        $res=$demoM->getList();
+        if($res['code']>0){
+            $this->error($res['code'],$res['msg']);
+        }
+        $this->success($res['data']);
+    }
+
+    public function add(){
+        $demoM=new \app\common\model\Demo();
+        $res=$demoM->add();
+        if($res['code']>0){
+            $this->error($res['code'],$res['msg']);
+        }
+        $this->success($res['data']);
+    }
+
+    public function edit(){
+        $demoM=new \app\common\model\Demo();
+        $res=$demoM->edit();
+        if($res['code']>0){
+            $this->error($res['code'],$res['msg']);
+        }
+        $this->success($res['data']);
+    }
+
+    public function detail(){
+        $demoM=new \app\common\model\Demo();
+        $res=$demoM->detail();
+        if($res['code']>0){
+            $this->error($res['code'],$res['msg']);
+        }
+        $this->success($res['data']);
+    }
+
+    public function del(){
+        $demoM=new \app\common\model\Demo();
+        $res=$demoM->del();
+        if($res['code']>0){
+            $this->error($res['code'],$res['msg']);
+        }
+        $this->success($res['data']);
+    }
+
+}

+ 68 - 0
thinkphp6/app/index/controller/Excel.php

@@ -0,0 +1,68 @@
+<?php
+
+
+namespace app\index\controller;
+
+
+use PhpOffice\PhpSpreadsheet\IOFactory;
+
+class Excel
+{
+
+    public function compaire()
+    {
+        writeln("compaire begin");
+
+        $exel = ROOT_DIR . "/excel/rhasd211027.xlsx";
+        writeln($exel);
+
+        $spreadsheet = IOFactory::load($exel);
+        //格式化数据
+        $sheet1 = $spreadsheet->getSheet(0);
+        $array1 = $sheet1->toArray();
+        foreach ($array1 as $key => $value) {
+            //银行卡
+            $array1[$key][1] = str_replace("'", "", $value[1]);
+            $array1[$key][1] = trim(str_replace(" ", "", $array1[$key][1]));
+            //状态
+            $array1[$key][4] = trim($value[4]);
+
+        }
+        $sheet2 = $spreadsheet->getSheet(1);
+        $array2 = $sheet2->toArray();
+        foreach ($array2 as $key => $value) {
+            //银行卡
+            $array2[$key][4] = str_replace("'", "", $value[4]);
+            $array2[$key][4] = trim(str_replace(" ", "", $array2[$key][4]));
+            //状态
+            $array2[$key][9] = trim($value[9]);
+
+        }
+        //比对
+
+        $diffArr = [];
+        foreach ($array1 as $key1 => $value1) {
+            if ($key1 == 0) {
+                continue;
+            }
+            //writeln("key1:" . $key1);
+            $isSame = false;
+            foreach ($array2 as $key2 => $value2) {
+                if ($value1[1] == $value2[4] && $value1[4] == $value2[9] && $value1[2] == $value2[6]) {
+                    $isSame = true;
+                    break;
+                }
+            }
+            if (!$isSame) {
+                $diffArr[] = $value1;
+            }
+        }
+        writeln("差异的记录:");
+        foreach ($diffArr as $key => $value) {
+            writeln($value);
+        }
+
+        writeln("compaire end");
+    }
+
+}

+ 42 - 0
thinkphp6/app/index/controller/Index.php

@@ -0,0 +1,42 @@
+<?php
+/**
+ * Created by PhpStorm.
+ * User: yckj_lzj
+ * Date: 2020-05-19
+ * Time: 19:11
+ */
+
+namespace app\index\controller;
+//controller
+//controller
+
+
+use app\common\model\Art;
+use app\common\model\ArtClass;
+use think\facade\Log;
+
+class Index
+{
+    public function index()
+    {
+        echo "hello " . date("Y-m-d H:i:s");
+//        var_dump(getVirRootDir());
+//        var_dump(ROOT_DIR);
+//        var_dump(WEB_DIR);
+    }
+
+    public function testDel()
+    {
+
+        Log::record(date("Y-m-d H:i:s") . "==================");
+
+
+
+    }
+
+    private function writeln($obj)
+    {
+        echo print_r($obj, true) . "\r\n<br />";
+    }
+
+}

+ 10 - 0
thinkphp6/app/middleware.php

@@ -0,0 +1,10 @@
+<?php
+// 全局中间件定义文件
+return [
+    // 全局请求缓存
+    // \think\middleware\CheckRequestCache::class,
+    // 多语言加载
+    // \think\middleware\LoadLangPack::class,
+    // Session初始化
+    // \think\middleware\SessionInit::class
+];

+ 9 - 0
thinkphp6/app/provider.php

@@ -0,0 +1,9 @@
+<?php
+use app\ExceptionHandle;
+use app\Request;
+
+// 容器Provider定义文件
+return [
+    'think\Request'          => Request::class,
+    'think\exception\Handle' => ExceptionHandle::class,
+];

+ 9 - 0
thinkphp6/app/service.php

@@ -0,0 +1,9 @@
+<?php
+
+use app\AppService;
+
+// 系统服务定义文件
+// 服务在完成全局初始化之后执行
+return [
+    AppService::class,
+];

+ 50 - 0
thinkphp6/composer.json

@@ -0,0 +1,50 @@
+{
+    "name": "topthink/think",
+    "description": "the new thinkphp framework",
+    "type": "project",
+    "keywords": [
+        "framework",
+        "thinkphp",
+        "ORM"
+    ],
+    "homepage": "http://thinkphp.cn/",
+    "license": "Apache-2.0",
+    "authors": [
+        {
+            "name": "liu21st",
+            "email": "liu21st@gmail.com"
+        },
+        {
+            "name": "yunwuxin",
+            "email": "448901948@qq.com"
+        }        
+    ],
+    "require": {
+        "php": ">=7.1.0",
+        "topthink/framework": "^6.0.0",
+        "topthink/think-orm": "^2.0",
+        "topthink/think-multi-app": "^1.0",
+        "phpoffice/phpspreadsheet": "^1.18"
+    },
+    "require-dev": {
+        "symfony/var-dumper": "^4.2",
+        "topthink/think-trace":"^1.0"
+    },
+    "autoload": {
+        "psr-4": {
+            "app\\": "app"
+        },
+        "psr-0": {
+            "": "extend/"
+        }
+    },
+    "config": {
+        "preferred-install": "dist"
+    },
+    "scripts": {
+        "post-autoload-dump": [
+            "@php think service:discover",
+            "@php think vendor:publish"
+        ]
+    }
+}

Datei-Diff unterdrückt, da er zu groß ist
+ 1780 - 0
thinkphp6/composer.lock


+ 34 - 0
thinkphp6/config/app.php

@@ -0,0 +1,34 @@
+<?php
+// +----------------------------------------------------------------------
+// | 应用设置
+// +----------------------------------------------------------------------
+
+return [
+    // 应用地址
+    'app_host'         => env('app.host', ''),
+    // 应用的命名空间
+    'app_namespace'    => '',
+    // 是否启用路由
+    'with_route'       => true,
+    // 是否启用事件
+    'with_event'       => true,
+    // 默认应用
+    'default_app'      => 'index',
+    // 默认时区
+    'default_timezone' => 'Asia/Shanghai',
+
+    // 应用映射(自动多应用模式有效)
+    'app_map'          => [],
+    // 域名绑定(自动多应用模式有效)
+    'domain_bind'      => [],
+    // 禁止URL访问的应用列表(自动多应用模式有效)
+    'deny_app_list'    => [],
+
+    // 异常页面的模板文件
+    'exception_tmpl'   => app()->getThinkPath() . 'tpl/think_exception.tpl',
+
+    // 错误显示信息,非调试模式有效
+    'error_message'    => '页面错误!请稍后再试~',
+    // 显示错误信息
+    'show_error_msg'   => false,
+];

+ 29 - 0
thinkphp6/config/cache.php

@@ -0,0 +1,29 @@
+<?php
+
+// +----------------------------------------------------------------------
+// | 缓存设置
+// +----------------------------------------------------------------------
+
+return [
+    // 默认缓存驱动
+    'default' => env('cache.driver', 'file'),
+
+    // 缓存连接方式配置
+    'stores'  => [
+        'file' => [
+            // 驱动方式
+            'type'       => 'File',
+            // 缓存保存目录
+            'path'       => '',
+            // 缓存前缀
+            'prefix'     => '',
+            // 缓存有效期 0表示永久缓存
+            'expire'     => 0,
+            // 缓存标签前缀
+            'tag_prefix' => 'tag:',
+            // 序列化机制 例如 ['serialize', 'unserialize']
+            'serialize'  => [],
+        ],
+        // 更多的缓存连接
+    ],
+];

+ 4 - 0
thinkphp6/config/common.php

@@ -0,0 +1,4 @@
+<?php
+return [
+    "api_sign_secret"=>"32a1ff74699ff2d6ce4c497cb94cb5c8",//接口签名秘钥
+];

+ 9 - 0
thinkphp6/config/console.php

@@ -0,0 +1,9 @@
+<?php
+// +----------------------------------------------------------------------
+// | 控制台配置
+// +----------------------------------------------------------------------
+return [
+    // 指令定义
+    'commands' => [
+    ],
+];

+ 18 - 0
thinkphp6/config/cookie.php

@@ -0,0 +1,18 @@
+<?php
+// +----------------------------------------------------------------------
+// | Cookie设置
+// +----------------------------------------------------------------------
+return [
+    // cookie 保存时间
+    'expire'    => 0,
+    // cookie 保存路径
+    'path'      => '/',
+    // cookie 有效域名
+    'domain'    => '',
+    //  cookie 启用安全传输
+    'secure'    => false,
+    // httponly设置
+    'httponly'  => false,
+    // 是否使用 setcookie
+    'setcookie' => true,
+];

+ 62 - 0
thinkphp6/config/database.php

@@ -0,0 +1,62 @@
+<?php
+
+return [
+    // 默认使用的数据库连接配置
+    'default'         => env('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('database.type', 'mysql'),
+            // 服务器地址
+            'hostname'          => env('database.hostname', '127.0.0.1'),
+            // 数据库名
+            'database'          => env('database.database', ''),
+            // 用户名
+            'username'          => env('database.username', 'root'),
+            // 密码
+            'password'          => env('database.password', ''),
+            // 端口
+            'hostport'          => env('database.hostport', '3306'),
+            // 数据库连接参数
+            'params'            => [],
+            // 数据库编码默认采用utf8
+            'charset'           => env('database.charset', 'utf8'),
+            // 数据库表前缀
+            'prefix'            => env('database.prefix', ''),
+
+            // 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器)
+            'deploy'            => 0,
+            // 数据库读写是否分离 主从式有效
+            'rw_separate'       => false,
+            // 读写分离后 主服务器数量
+            'master_num'        => 1,
+            // 指定从服务器序号
+            'slave_no'          => '',
+            // 是否严格检查字段是否存在
+            'fields_strict'     => true,
+            // 是否需要断线重连
+            'break_reconnect'   => false,
+            // 监听SQL
+            'trigger_sql'       => env('app_debug', true),
+            // 开启字段缓存
+            'fields_cache'      => false,
+            // 字段缓存路径
+            'schema_cache_path' => app()->getRuntimePath() . 'schema' . DIRECTORY_SEPARATOR,
+        ],
+
+        // 更多的数据库配置信息
+    ],
+];

+ 24 - 0
thinkphp6/config/filesystem.php

@@ -0,0 +1,24 @@
+<?php
+
+return [
+    // 默认磁盘
+    'default' => env('filesystem.driver', 'local'),
+    // 磁盘列表
+    'disks'   => [
+        'local'  => [
+            'type' => 'local',
+            'root' => app()->getRuntimePath() . 'storage',
+        ],
+        'public' => [
+            // 磁盘类型
+            'type'       => 'local',
+            // 磁盘路径
+            'root'       => app()->getRootPath() . 'public/storage',
+            // 磁盘路径对应的外部URL路径
+            'url'        => '/storage',
+            // 可见性
+            'visibility' => 'public',
+        ],
+        // 更多的磁盘配置信息
+    ],
+];

+ 25 - 0
thinkphp6/config/lang.php

@@ -0,0 +1,25 @@
+<?php
+// +----------------------------------------------------------------------
+// | 多语言设置
+// +----------------------------------------------------------------------
+
+return [
+    // 默认语言
+    'default_lang'    => env('lang.default_lang', 'zh-cn'),
+    // 允许的语言列表
+    'allow_lang_list' => [],
+    // 多语言自动侦测变量名
+    'detect_var'      => 'lang',
+    // 是否使用Cookie记录
+    'use_cookie'      => true,
+    // 多语言cookie变量
+    'cookie_var'      => 'think_lang',
+    // 扩展语言包
+    'extend_list'     => [],
+    // Accept-Language转义为对应语言包名称
+    'accept_language' => [
+        'zh-hans-cn' => 'zh-cn',
+    ],
+    // 是否支持语言分组
+    'allow_group'     => false,
+];

+ 45 - 0
thinkphp6/config/log.php

@@ -0,0 +1,45 @@
+<?php
+
+// +----------------------------------------------------------------------
+// | 日志设置
+// +----------------------------------------------------------------------
+return [
+    // 默认日志记录通道
+    'default'      => env('log.channel', 'file'),
+    // 日志记录级别
+    'level'        => [],
+    // 日志类型记录的通道 ['error'=>'email',...]
+    'type_channel' => [],
+    // 关闭全局日志写入
+    'close'        => false,
+    // 全局日志处理 支持闭包
+    'processor'    => null,
+
+    // 日志通道列表
+    'channels'     => [
+        'file' => [
+            // 日志记录方式
+            'type'           => 'File',
+            // 日志保存目录
+            'path'           => '',
+            // 单文件日志写入
+            'single'         => false,
+            // 独立日志级别
+            'apart_level'    => [],
+            // 最大日志文件数量
+            'max_files'      => 0,
+            // 使用JSON格式记录
+            'json'           => false,
+            // 日志处理
+            'processor'      => null,
+            // 关闭通道日志写入
+            'close'          => false,
+            // 日志输出格式化
+            'format'         => '[%s][%s] %s',
+            // 是否实时写入
+            'realtime_write' => false,
+        ],
+        // 其它日志通道配置
+    ],
+
+];

+ 8 - 0
thinkphp6/config/middleware.php

@@ -0,0 +1,8 @@
+<?php
+// 中间件配置
+return [
+    // 别名或分组
+    'alias'    => [],
+    // 优先级设置,此数组中的中间件会按照数组中的顺序优先执行
+    'priority' => [],
+];

+ 45 - 0
thinkphp6/config/route.php

@@ -0,0 +1,45 @@
+<?php
+// +----------------------------------------------------------------------
+// | 路由设置
+// +----------------------------------------------------------------------
+
+return [
+    // pathinfo分隔符
+    'pathinfo_depr'         => '/',
+    // URL伪静态后缀
+    'url_html_suffix'       => 'html',
+    // URL普通方式参数 用于自动生成
+    'url_common_param'      => true,
+    // 是否开启路由延迟解析
+    'url_lazy_route'        => false,
+    // 是否强制使用路由
+    'url_route_must'        => false,
+    // 合并路由规则
+    'route_rule_merge'      => false,
+    // 路由是否完全匹配
+    'route_complete_match'  => false,
+    // 访问控制器层名称
+    'controller_layer'      => 'controller',
+    // 空控制器名
+    'empty_controller'      => 'Error',
+    // 是否使用控制器后缀
+    'controller_suffix'     => false,
+    // 默认的路由变量规则
+    'default_route_pattern' => '[\w\.]+',
+    // 是否开启请求缓存 true自动缓存 支持设置请求缓存规则
+    'request_cache'         => false,
+    // 请求缓存有效期
+    'request_cache_expire'  => null,
+    // 全局请求缓存排除规则
+    'request_cache_except'  => [],
+    // 默认控制器名
+    'default_controller'    => 'Index',
+    // 默认操作名
+    'default_action'        => 'index',
+    // 操作方法后缀
+    'action_suffix'         => '',
+    // 默认JSONP格式返回的处理方法
+    'default_jsonp_handler' => 'jsonpReturn',
+    // 默认JSONP处理方法
+    'var_jsonp_handler'     => 'callback',
+];

+ 19 - 0
thinkphp6/config/session.php

@@ -0,0 +1,19 @@
+<?php
+// +----------------------------------------------------------------------
+// | 会话设置
+// +----------------------------------------------------------------------
+
+return [
+    // session name
+    'name'           => 'PHPSESSID',
+    // SESSION_ID的提交变量,解决flash上传跨域
+    'var_session_id' => '',
+    // 驱动方式 支持file cache
+    'type'           => 'file',
+    // 存储连接标识 当type使用cache的时候有效
+    'store'          => null,
+    // 过期时间
+    'expire'         => 1440,
+    // 前缀
+    'prefix'         => '',
+];

+ 10 - 0
thinkphp6/config/trace.php

@@ -0,0 +1,10 @@
+<?php
+// +----------------------------------------------------------------------
+// | Trace设置 开启调试模式后有效
+// +----------------------------------------------------------------------
+return [
+    // 内置Html和Console两种方式 支持扩展
+    'type'    => 'Html',
+    // 读取的日志通道名
+    'channel' => '',
+];

+ 25 - 0
thinkphp6/config/view.php

@@ -0,0 +1,25 @@
+<?php
+// +----------------------------------------------------------------------
+// | 模板设置
+// +----------------------------------------------------------------------
+
+return [
+    // 模板引擎类型使用Think
+    'type'          => 'Think',
+    // 默认模板渲染规则 1 解析为小写+下划线 2 全部转换小写 3 保持操作方法
+    'auto_rule'     => 1,
+    // 模板目录名
+    'view_dir_name' => 'view',
+    // 模板后缀
+    'view_suffix'   => 'html',
+    // 模板文件名分隔符
+    'view_depr'     => DIRECTORY_SEPARATOR,
+    // 模板引擎普通标签开始标记
+    'tpl_begin'     => '{',
+    // 模板引擎普通标签结束标记
+    'tpl_end'       => '}',
+    // 标签库标签开始标记
+    'taglib_begin'  => '{',
+    // 标签库标签结束标记
+    'taglib_end'    => '}',
+];

+ 53 - 0
thinkphp6/demo.sql

@@ -0,0 +1,53 @@
+/*
+Navicat MySQL Data Transfer
+
+Source Server         : 0localhost
+Source Server Version : 50726
+Source Host           : localhost:3306
+Source Database       : demo
+
+Target Server Type    : MYSQL
+Target Server Version : 50726
+File Encoding         : 65001
+
+Date: 2021-04-16 00:44:04
+*/
+
+SET FOREIGN_KEY_CHECKS=0;
+
+-- ----------------------------
+-- Table structure for demo
+-- ----------------------------
+DROP TABLE IF EXISTS `demo`;
+CREATE TABLE `demo` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `title` varchar(255) DEFAULT '' COMMENT '标题',
+  `author` varchar(255) DEFAULT '' COMMENT '作者',
+  `content` text COMMENT '内容',
+  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
+  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
+  `delete_time` varchar(255) DEFAULT NULL COMMENT '删除标志',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8mb4;
+
+-- ----------------------------
+-- Records of demo
+-- ----------------------------
+INSERT INTO `demo` VALUES ('1', '标题1', '作者1', '内容1', '2020-05-21 11:27:41', '2020-05-21 11:27:44', null);
+INSERT INTO `demo` VALUES ('3', '标题3', '作者1', '内容1', '2020-05-21 11:27:41', '2020-05-21 11:27:44', null);
+INSERT INTO `demo` VALUES ('4', '标题4', '作者1', '内容1', '2020-05-21 11:27:41', '2020-05-21 11:27:44', null);
+INSERT INTO `demo` VALUES ('5', '标题5', '作者1', '内容1', '2020-05-21 11:27:41', '2020-05-21 11:27:44', null);
+INSERT INTO `demo` VALUES ('6', '标题6', '作者1', '内容1', '2020-05-21 11:27:41', '2020-05-21 11:27:44', null);
+INSERT INTO `demo` VALUES ('7', '标题7', '作者1', '内容1', '2020-05-21 11:27:41', '2020-05-21 11:27:44', null);
+INSERT INTO `demo` VALUES ('8', '标题8', '作者1', '内容1', '2020-05-21 11:27:41', '2020-05-21 11:27:44', null);
+INSERT INTO `demo` VALUES ('9', '标题9', '作者1', '内容1', '2020-05-21 11:27:41', '2020-05-21 11:27:44', null);
+INSERT INTO `demo` VALUES ('10', '标题10', '作者1', '内容1', '2020-05-21 11:27:41', '2020-05-21 11:27:44', null);
+INSERT INTO `demo` VALUES ('11', '标题11', '作者1', '内容1', '2020-05-21 11:27:41', '2020-05-21 11:27:44', null);
+INSERT INTO `demo` VALUES ('12', '标题12', '作者1', '内容1', '2020-05-21 11:27:41', '2020-05-21 11:27:44', null);
+INSERT INTO `demo` VALUES ('13', '标题录入1 ', '作者', '这是内容', '2020-05-21 12:13:46', '2020-05-21 12:13:46', null);
+INSERT INTO `demo` VALUES ('14', '标题录入1 ', '作者', '这是内容', '2020-05-21 12:14:00', '2020-05-21 12:14:00', null);
+INSERT INTO `demo` VALUES ('15', '标题录入1 ', '作者', '这是内容', '2020-05-21 12:14:13', '2020-05-21 12:14:13', null);
+INSERT INTO `demo` VALUES ('16', '标题录入1 ', '作者', '这是内容', '2020-05-21 12:14:29', '2020-05-21 12:14:29', null);
+INSERT INTO `demo` VALUES ('17', '标题录入1 ', '作者', '这是内容', '2020-05-21 12:14:35', '2020-05-21 12:14:35', null);
+INSERT INTO `demo` VALUES ('18', '标题录入1 ', '作者', '这是内容', '2020-05-21 12:15:10', '2020-05-21 12:15:10', null);
+INSERT INTO `demo` VALUES ('19', '标题录入2', '作者', '这是内容', '2020-05-21 12:16:31', '2020-05-21 12:16:31', null);

+ 2 - 0
thinkphp6/extend/.gitignore

@@ -0,0 +1,2 @@
+*
+!.gitignore

+ 8 - 0
thinkphp6/public/.htaccess

@@ -0,0 +1,8 @@
+<IfModule mod_rewrite.c>
+  Options +FollowSymlinks -Multiviews
+  RewriteEngine On
+
+  RewriteCond %{REQUEST_FILENAME} !-d
+  RewriteCond %{REQUEST_FILENAME} !-f
+  RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
+</IfModule>

BIN
thinkphp6/public/excel/rhasd211027.xlsx


BIN
thinkphp6/public/favicon.ico


+ 37 - 0
thinkphp6/public/index.php

@@ -0,0 +1,37 @@
+<?php
+// +----------------------------------------------------------------------
+// | ThinkPHP [ WE CAN DO IT JUST THINK ]
+// +----------------------------------------------------------------------
+// | Copyright (c) 2006-2019 http://thinkphp.cn All rights reserved.
+// +----------------------------------------------------------------------
+// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
+// +----------------------------------------------------------------------
+// | Author: liu21st <liu21st@gmail.com>
+// +----------------------------------------------------------------------
+
+
+
+// [ 应用入口文件 ]
+namespace think;
+
+require __DIR__ . '/../vendor/autoload.php';
+
+define('ROOT_DIR',__DIR__);//定义根目录物理路径
+define('WEB_DIR',dirname($_SERVER['SCRIPT_NAME']));//定义根目录虚拟路径
+
+header("Access-Control-Allow-Credentials:true");
+header("Access-Control-Allow-Origin:*");//注意修改这里填写你的前端的域名
+header("Access-Control-Max-Age:3600");
+header("Access-Control-Allow-Headers:*");
+//header("Access-Control-Allow-Headers:DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization,SessionToken,X-Token");
+
+header('Access-Control-Allow-Methods: GET, POST, PUT,DELETE,OPTIONS, POIST');
+
+// 执行HTTP应用并响应
+$http = (new App())->http;
+
+$response = $http->run();
+
+$response->send();
+
+$http->end($response);

+ 2 - 0
thinkphp6/public/robots.txt

@@ -0,0 +1,2 @@
+User-agent: *
+Disallow:

+ 19 - 0
thinkphp6/public/router.php

@@ -0,0 +1,19 @@
+<?php
+// +----------------------------------------------------------------------
+// | ThinkPHP [ WE CAN DO IT JUST THINK ]
+// +----------------------------------------------------------------------
+// | Copyright (c) 2006~2019 http://thinkphp.cn All rights reserved.
+// +----------------------------------------------------------------------
+// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
+// +----------------------------------------------------------------------
+// | Author: liu21st <liu21st@gmail.com>
+// +----------------------------------------------------------------------
+// $Id$
+
+if (is_file($_SERVER["DOCUMENT_ROOT"] . $_SERVER["SCRIPT_NAME"])) {
+    return false;
+} else {
+    $_SERVER["SCRIPT_FILENAME"] = __DIR__ . '/index.php';
+
+    require __DIR__ . "/index.php";
+}

+ 2 - 0
thinkphp6/public/static/.gitignore

@@ -0,0 +1,2 @@
+*
+!.gitignore

+ 17 - 0
thinkphp6/route/app.php

@@ -0,0 +1,17 @@
+<?php
+// +----------------------------------------------------------------------
+// | ThinkPHP [ WE CAN DO IT JUST THINK ]
+// +----------------------------------------------------------------------
+// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
+// +----------------------------------------------------------------------
+// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
+// +----------------------------------------------------------------------
+// | Author: liu21st <liu21st@gmail.com>
+// +----------------------------------------------------------------------
+use think\facade\Route;
+
+Route::get('think', function () {
+    return 'hello,ThinkPHP6!';
+});
+
+Route::get('hello/:name', 'index/hello');

+ 10 - 0
thinkphp6/think

@@ -0,0 +1,10 @@
+#!/usr/bin/env php
+<?php
+namespace think;
+
+// 命令行入口文件
+// 加载基础文件
+require __DIR__ . '/vendor/autoload.php';
+
+// 应用初始化
+(new App())->console->run();

+ 1 - 0
thinkphp6/view/README.md

@@ -0,0 +1 @@
+如果不使用模板,可以删除该目录

+ 1 - 0
thinkphp6/首次使用说明.txt

@@ -0,0 +1 @@
+首次使用,请使用composer下载所有依赖