From 1642c22b03180e4e8de28788bbf5bf49faa05320 Mon Sep 17 00:00:00 2001 From: ahbmz Date: Wed, 24 Apr 2024 12:21:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 12 + .travis.yml | 42 ++++ LICENSE.txt | 32 +++ README.md | 79 +++++++ app/.htaccess | 1 + app/404.html | 10 + app/AppService.php | 22 ++ app/BaseController.php | 94 ++++++++ app/ExceptionHandle.php | 58 +++++ app/Request.php | 8 + app/adminapi/common.php | 2 + app/adminapi/controller/Demo.php | 95 ++++++++ app/adminapi/controller/Error.php | 17 ++ app/adminapi/controller/Index.php | 12 + app/adminapi/event.php | 5 + app/adminapi/middleware.php | 5 + app/adminapi/model/Demo.php | 23 ++ app/adminapi/provider.php | 10 + app/api/common.php | 2 + app/api/controller/Index.php | 12 + app/api/controller/v1/Demo.php | 20 ++ app/api/event.php | 5 + app/api/middleware.php | 5 + app/api/provider.php | 10 + app/common.php | 275 ++++++++++++++++++++++ app/event.php | 17 ++ app/exception/ExceptionHandle.php | 82 +++++++ app/exception/HttpException.php | 42 ++++ app/index/common.php | 2 + app/index/config/app.php | 9 + app/index/controller/Index.php | 14 ++ app/index/event.php | 5 + app/index/middleware.php | 5 + app/middleware.php | 10 + app/provider.php | 9 + app/service.php | 9 + composer.json | 51 ++++ config/app.php | 33 +++ config/cache.php | 29 +++ config/console.php | 9 + config/cookie.php | 20 ++ config/database.php | 65 +++++ config/dictionary.php | 75 ++++++ config/filesystem.php | 24 ++ config/lang.php | 27 +++ config/log.php | 45 ++++ config/middleware.php | 8 + config/route.php | 45 ++++ config/session.php | 19 ++ config/trace.php | 10 + config/view.php | 25 ++ extend/.gitignore | 2 + public/.htaccess | 8 + public/favicon.ico | Bin 0 -> 5434 bytes public/index.php | 24 ++ public/robots.txt | 2 + public/router.php | 19 ++ public/static/.gitignore | 2 + route/app.php | 13 + runtime/temp/76f9cf949a2861fa62a30ddee32bbbd0.php | 11 + think | 10 + view/README.md | 1 + 62 files changed, 1637 insertions(+) create mode 100644 .gitignore create mode 100644 .travis.yml create mode 100644 LICENSE.txt create mode 100644 README.md create mode 100644 app/.htaccess create mode 100644 app/404.html create mode 100644 app/AppService.php create mode 100644 app/BaseController.php create mode 100644 app/ExceptionHandle.php create mode 100644 app/Request.php create mode 100644 app/adminapi/common.php create mode 100644 app/adminapi/controller/Demo.php create mode 100644 app/adminapi/controller/Error.php create mode 100644 app/adminapi/controller/Index.php create mode 100644 app/adminapi/event.php create mode 100644 app/adminapi/middleware.php create mode 100644 app/adminapi/model/Demo.php create mode 100644 app/adminapi/provider.php create mode 100644 app/api/common.php create mode 100644 app/api/controller/Index.php create mode 100644 app/api/controller/v1/Demo.php create mode 100644 app/api/event.php create mode 100644 app/api/middleware.php create mode 100644 app/api/provider.php create mode 100644 app/common.php create mode 100644 app/event.php create mode 100644 app/exception/ExceptionHandle.php create mode 100644 app/exception/HttpException.php create mode 100644 app/index/common.php create mode 100644 app/index/config/app.php create mode 100644 app/index/controller/Index.php create mode 100644 app/index/event.php create mode 100644 app/index/middleware.php create mode 100644 app/middleware.php create mode 100644 app/provider.php create mode 100644 app/service.php create mode 100644 composer.json create mode 100644 config/app.php create mode 100644 config/cache.php create mode 100644 config/console.php create mode 100644 config/cookie.php create mode 100644 config/database.php create mode 100644 config/dictionary.php create mode 100644 config/filesystem.php create mode 100644 config/lang.php create mode 100644 config/log.php create mode 100644 config/middleware.php create mode 100644 config/route.php create mode 100644 config/session.php create mode 100644 config/trace.php create mode 100644 config/view.php create mode 100644 extend/.gitignore create mode 100644 public/.htaccess create mode 100644 public/favicon.ico create mode 100644 public/index.php create mode 100644 public/robots.txt create mode 100644 public/router.php create mode 100644 public/static/.gitignore create mode 100644 route/app.php create mode 100644 runtime/temp/76f9cf949a2861fa62a30ddee32bbbd0.php create mode 100644 think create mode 100644 view/README.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5054a67 --- /dev/null +++ b/.gitignore @@ -0,0 +1,12 @@ +*.log +.env +composer.phar +composer.lock +.DS_Store +Thumbs.db +/.idea +/.vscode +/vendor +/.settings +/.buildpath +/.project \ No newline at end of file diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..36f7b6f --- /dev/null +++ b/.travis.yml @@ -0,0 +1,42 @@ +sudo: false + +language: php + +branches: + only: + - stable + +cache: + directories: + - $HOME/.composer/cache + +before_install: + - composer self-update + +install: + - composer install --no-dev --no-interaction --ignore-platform-reqs + - zip -r --exclude='*.git*' --exclude='*.zip' --exclude='*.travis.yml' ThinkPHP_Core.zip . + - composer require --update-no-dev --no-interaction "topthink/think-image:^1.0" + - composer require --update-no-dev --no-interaction "topthink/think-migration:^1.0" + - composer require --update-no-dev --no-interaction "topthink/think-captcha:^1.0" + - composer require --update-no-dev --no-interaction "topthink/think-mongo:^1.0" + - composer require --update-no-dev --no-interaction "topthink/think-worker:^1.0" + - composer require --update-no-dev --no-interaction "topthink/think-helper:^1.0" + - composer require --update-no-dev --no-interaction "topthink/think-queue:^1.0" + - composer require --update-no-dev --no-interaction "topthink/think-angular:^1.0" + - composer require --dev --update-no-dev --no-interaction "topthink/think-testing:^1.0" + - zip -r --exclude='*.git*' --exclude='*.zip' --exclude='*.travis.yml' ThinkPHP_Full.zip . + +script: + - php think unit + +deploy: + provider: releases + api_key: + secure: TSF6bnl2JYN72UQOORAJYL+CqIryP2gHVKt6grfveQ7d9rleAEoxlq6PWxbvTI4jZ5nrPpUcBUpWIJHNgVcs+bzLFtyh5THaLqm39uCgBbrW7M8rI26L8sBh/6nsdtGgdeQrO/cLu31QoTzbwuz1WfAVoCdCkOSZeXyT/CclH99qV6RYyQYqaD2wpRjrhA5O4fSsEkiPVuk0GaOogFlrQHx+C+lHnf6pa1KxEoN1A0UxxVfGX6K4y5g4WQDO5zT4bLeubkWOXK0G51XSvACDOZVIyLdjApaOFTwamPcD3S1tfvuxRWWvsCD5ljFvb2kSmx5BIBNwN80MzuBmrGIC27XLGOxyMerwKxB6DskNUO9PflKHDPI61DRq0FTy1fv70SFMSiAtUv9aJRT41NQh9iJJ0vC8dl+xcxrWIjU1GG6+l/ZcRqVx9V1VuGQsLKndGhja7SQ+X1slHl76fRq223sMOql7MFCd0vvvxVQ2V39CcFKao/LB1aPH3VhODDEyxwx6aXoTznvC/QPepgWsHOWQzKj9ftsgDbsNiyFlXL4cu8DWUty6rQy8zT2b4O8b1xjcwSUCsy+auEjBamzQkMJFNlZAIUrukL/NbUhQU37TAbwsFyz7X0E/u/VMle/nBCNAzgkMwAUjiHM6FqrKKBRWFbPrSIixjfjkCnrMEPw= + file: + - ThinkPHP_Core.zip + - ThinkPHP_Full.zip + skip_cleanup: true + on: + tags: true diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..3dcd79f --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,32 @@ + +ThinkPHP遵循Apache2开源协议发布,并提供免费使用。 +版权所有Copyright © 2006-2023 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. diff --git a/README.md b/README.md new file mode 100644 index 0000000..d1e7881 --- /dev/null +++ b/README.md @@ -0,0 +1,79 @@ +![](https://www.thinkphp.cn/uploads/images/20230630/300c856765af4d8ae758c503185f8739.png) + +ThinkPHP 8.0 +=============== + +## 特性 + +* 基于PHP`8.0+`重构 +* 升级`PSR`依赖 +* 依赖`think-orm`3.0版本 +* `6.0`/`6.1`无缝升级 + + +> ThinkPHP8.0的运行环境要求PHP8.0.0+ + +现在开始,你可以使用官方提供的[ThinkChat](https://chat.topthink.com/),让你在学习ThinkPHP的旅途中享受私人AI助理服务! + +![](https://www.topthink.com/uploads/assistant/20230630/4d1a3f0ad2958b49bb8189b7ef824cb0.png) + +## 文档 + +[完全开发手册](https://doc.thinkphp.cn) + +## 服务 + +ThinkPHP生态服务由[顶想云](https://www.topthink.com)(TOPThink Cloud)提供,为生态提供专业的开发者服务和价值之选。 + +## 赞助 +全新的[赞助计划](https://www.thinkphp.cn/sponsor)可以让你通过我们的网站、手册、欢迎页及GIT仓库获得巨大曝光,同时提升企业的品牌声誉,也更好保障ThinkPHP的可持续发展。 + +[![](https://www.thinkphp.cn/uploads/images/20230630/48396092a0515886a3da6bd268131c8f.png)](http://github.crmeb.net/u/TPSY) + +[![](https://www.thinkphp.cn/uploads/images/20230630/a12bd248beee0e7491dd0f79dc4dd5e9.png)](https://www.thinkphp.cn/sponsor) + +[![](https://www.thinkphp.cn/uploads/images/20230630/e7f48d909d41dd5ebaf4a5aa982d0455.png)](https://www.thinkphp.cn/sponsor) + +## 安装 + +~~~ +composer create-project topthink/think tp +~~~ + +启动服务 + +~~~ +cd tp +php think run +~~~ + +然后就可以在浏览器中访问 + +~~~ +http://localhost:8000 +~~~ + +如果需要更新框架使用 +~~~ +composer update topthink/framework +~~~ + +## 命名规范 + +`ThinkPHP`遵循PSR-2命名规范和PSR-4自动加载规范。 + +## 参与开发 + +直接提交PR或者Issue即可 + +## 版权信息 + +ThinkPHP遵循Apache2开源协议发布,并提供免费使用。 + +本项目包含的第三方源码和二进制文件之版权信息另行标注。 + +版权所有Copyright © 2006-2023 by ThinkPHP (http://thinkphp.cn) All rights reserved。 + +ThinkPHP® 商标和著作权所有者为上海顶想信息科技有限公司。 + +更多细节参阅 [LICENSE.txt](LICENSE.txt) diff --git a/app/.htaccess b/app/.htaccess new file mode 100644 index 0000000..3418e55 --- /dev/null +++ b/app/.htaccess @@ -0,0 +1 @@ +deny from all \ No newline at end of file diff --git a/app/404.html b/app/404.html new file mode 100644 index 0000000..12f2a5d --- /dev/null +++ b/app/404.html @@ -0,0 +1,10 @@ + + + + + Title + + +[自定义404] + + \ No newline at end of file diff --git a/app/AppService.php b/app/AppService.php new file mode 100644 index 0000000..96556e8 --- /dev/null +++ b/app/AppService.php @@ -0,0 +1,22 @@ +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, string|array $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); + } + +} diff --git a/app/ExceptionHandle.php b/app/ExceptionHandle.php new file mode 100644 index 0000000..453d126 --- /dev/null +++ b/app/ExceptionHandle.php @@ -0,0 +1,58 @@ +list(); + } + + /** + * 保存新建的资源 + * + * @param \think\Request $request + * @return \think\Response + */ + public function save(Request $request) + { + // + } + + /** + * 显示指定的资源 + * + * @param int $id + * @return \think\Response + */ + public function read($id) + { + // + } + + /** + * 显示编辑资源表单页. + * + * @param int $id + * @return \think\Response + */ + public function edit($id) + { + // + } + + /** + * 保存更新的资源 + * + * @param \think\Request $request + * @param int $id + * @return \think\Response + */ + public function update(Request $request, $id) + { + // + } + + /** + * 删除指定资源 + * + * @param int $id + * @return \think\Response + */ + public function delete($id) + { + // + } +} diff --git a/app/adminapi/controller/Error.php b/app/adminapi/controller/Error.php new file mode 100644 index 0000000..d07dc1f --- /dev/null +++ b/app/adminapi/controller/Error.php @@ -0,0 +1,17 @@ + Request::class, +// 'think\exception\Handle' => ExceptionHandle::class, //原系统 + 'think\exception\Handle' => 'app\\exception\\ExceptionHandle', //自定义异常类 +]; diff --git a/app/api/common.php b/app/api/common.php new file mode 100644 index 0000000..1243615 --- /dev/null +++ b/app/api/common.php @@ -0,0 +1,2 @@ + Request::class, +// 'think\exception\Handle' => ExceptionHandle::class, //原系统 + 'think\exception\Handle' => 'app\\exception\\ExceptionHandle', //自定义异常类 +]; diff --git a/app/common.php b/app/common.php new file mode 100644 index 0000000..2b60b7d --- /dev/null +++ b/app/common.php @@ -0,0 +1,275 @@ +where('site_id', SITE_ID); + //id存在需要判断修改逻辑下排除id本身且不为空的情况下 有没有重复 + $id = !empty($data['id']) ? $data['id'] : ''; + if ($id) { + $_db->where('id', '<>', $id); + $_db->where($name, '<>', ' '); + } + $_data = $_db->where($name, $value)->find(); + if (empty($_data)) { + return true; + } + return $note . '已存在,请重新输入!!!'; +} + +/** + * json统一返回 + * @param type $code 状态编码 0正常 + * @param type $data 返回数据 + * @param type $msg 错误的提示信息 + * @return type + */ +function send_http_status($data = [], $code = 0, $httpStatus = 200, $msg = '') +{ + $msg = !empty($msg) ? $msg : config('dictionary')[$code]; + //排除成功的状态信息 + if (in_array($code, [201, 203, 205, 207, 209])) { + $code = 0; + } + + $_data = [ + 'code' => $code, + 'msg' => $msg, +// 'count' => 0, + 'data' => $data, + ]; + + //更改data2级数据为一级 增加列表页count数据 +// if (isset($data['count'])) { +// $_data['count'] = $data['count']; //前端框架element 1.30版本以前接口模式 +// $_data['data'] = empty($data['data']) ? [] : $data['data']; //前端框架element 1.30版本以前接口模式 +// } + + if ($code != 0 && $code != 200) { + throw new \app\exception\HttpException($httpStatus, $msg, $code); + } + return json($_data, $httpStatus); +} + +/** + * 把格式数组,拆分父栏目,与子栏目 + * @param type $arr 一级数组 + * @param type $pid 父id + * @param type $child_name 生成子数组的名称 + * @param type $primary 表的主键值,上一级id + * @return type + */ +function get_tree(array $arr, $pid = 0, $child_name = 'children', $primary = 'id') +{ + if (empty($arr)) { + return $arr; + } + if (is_array($arr)) { + $child = get_child($arr, $pid); + if (empty($child)) { + return null; + } + foreach ($child as $key => $value) { + $current_child = get_tree($arr, $value[$primary]); + if ($current_child != null) { + $child[$key][$child_name] = $current_child; + } + } + } + return $child; +} + +//根据pid获取子栏目 返回子栏目数组集合 +function get_child($arr, $pid = 0) +{ + if (is_array($arr)) { + $child = array(); + foreach ($arr as $key => $value) { + if ($value['parent_id'] == $pid) { + $child[$key] = $value; + } + } + return array_values($child); + } + return $arr; +} + + +/** + * 云掌图片服务器裁剪函数 + * @param $src 源地址,不带?号 + * @param $w 宽度 + * @param $h 高度 + * @param $g 裁剪位置 nw西北 north正北 ne东北 west正西 center中间 east正东 sw西南 south正南 se东南 + * @param string $type 执行方式 crop:裁剪 resize:缩放 + */ +function crop_thumb($src, $w = '', $h = '') +{ + //判断图片是不是全路径 + $cdn_img_host = strpos($src, 'http') !== 0 ? config('cdn_img_host') : ''; + if (empty($src) || !$w || !$h) { + return $cdn_img_host . $src; + } + //限制宽、高大小 + if ($w > 2000 || $w < 5 || $h > 2000 || $h < 5) { + return $src; + } + //有逗号分割符取第一张图片 + $first_pic = strstr($src, ',', true); + $src = !empty($first_pic) ? $first_pic : $src; + //拆分图片后缀 + $last_pos = strripos($src, '.'); //图片格式中点的位置 + $base_url = mb_substr($src, 0, $last_pos); //去图片后缀的url + $exp_url = mb_substr($src, $last_pos); //图片后缀 + return $cdn_img_host . $base_url . '_' . $w . 'x' . $h . $exp_url; +} + + +/** + * 判断浏览器名称和版本 + */ +function get_client_browser() +{ + $agent = !empty($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : false; + if (!$agent) { + return '获取不到浏览器信息'; + } + if ((strpos($agent, 'MSIE') == false) && (strpos($agent, 'Trident') !== FALSE)) { + return 'Internet Explorer 11.0'; + } + if (strpos($agent, 'MSIE 10.0') != false) { + return 'Internet Explorer 10.0'; + } + if (strpos($agent, 'MSIE 9.0') != false) { + return 'Internet Explorer 9.0'; + } + if (strpos($agent, 'MSIE 8.0') != false) { + return 'Internet Explorer 8.0'; + } + if (strpos($agent, 'MSIE 7.0') != false) { + return 'Internet Explorer 7.0'; + } + if (strpos($agent, 'MSIE 6.0') != false) { + return 'Internet Explorer 6.0'; + } + if (strpos($agent, 'Edge') != false) { + return 'Edge'; + } + if (strpos($agent, '360SE') != false) { + return '360SE'; + } + if (strpos($agent, 'QQBrowser') != false) { + return 'QQBrowser'; + } + if (strpos($agent, 'Firefox') != false) { + return 'Firefox'; + } + if (strpos($agent, 'Chrome') != false) { + return 'Chrome'; + } + if (strpos($agent, 'Safari') != false) { + return 'Safari'; + } + if (strpos($agent, 'Opera') != false) { + return 'Opera'; + } + //微信浏览器 + if (strpos($agent, 'MicroMessage') != false) { + return '微信浏览器'; + } + return '未知'; +} + +/** + * 获取系统类型 + */ +function get_client_os() +{ + + $agent = strtolower($_SERVER['HTTP_USER_AGENT']); + + if (strpos($agent, 'windows nt')) { + $platform = 'Windows'; + } elseif (strpos($agent, 'macintosh')) { + $platform = 'Mac'; + } elseif (strpos($agent, 'ipod')) { + $platform = 'iPod'; + } elseif (strpos($agent, 'ipad')) { + $platform = 'iPad'; + } elseif (strpos($agent, 'iphone')) { + $platform = 'iPhone'; + } elseif (strpos($agent, 'android')) { + $platform = 'Android'; + } elseif (strpos($agent, 'unix')) { + $platform = 'Unix'; + } elseif (strpos($agent, 'linux')) { + $platform = 'Linux'; + } else { + $platform = '其他'; + } + + return $platform; +} + +// + +function htmlspecialchars_custom($str) +{ + return htmlspecialchars($str, ENT_QUOTES); +} + +/** + * base64_url 使用base64对字符串编码后,会出现特殊符号'+','/','=' 去除=号等特殊字符 + * @param $data + * @return string + */ +function base64url_encode($data) { + + return rtrim(strtr(base64_encode($data), '+/', '-_'), '='); + +} + +/** + * base64_url + * @param $data + * @return false|string + */ +function base64url_decode($data) { + + return base64_decode(str_pad(strtr($data, '-_', '+/'), strlen($data) % 4, '=', STR_PAD_RIGHT)); + +} \ No newline at end of file diff --git a/app/event.php b/app/event.php new file mode 100644 index 0000000..e9851bb --- /dev/null +++ b/app/event.php @@ -0,0 +1,17 @@ + [ + ], + + 'listen' => [ + 'AppInit' => [], + 'HttpRun' => [], + 'HttpEnd' => [], + 'LogLevel' => [], + 'LogWrite' => [], + ], + + 'subscribe' => [ + ], +]; diff --git a/app/exception/ExceptionHandle.php b/app/exception/ExceptionHandle.php new file mode 100644 index 0000000..f4f43a2 --- /dev/null +++ b/app/exception/ExceptionHandle.php @@ -0,0 +1,82 @@ +msg = $e->getMessage() ?: $this->msg; + //兼容Exception类 这个类没有getStatusCode方法 + if ($e instanceof HttpException) { + $this->httpStatusCode = $e->getStatusCode() ?: $this->httpStatusCode; + } + $this->code = $e->getCode() ?: $this->code; + $data = [ + 'msg' => $this->msg, + 'data' => [], + 'code' => $this->code, + ]; + return json($data, $this->httpStatusCode); + + } +} diff --git a/app/exception/HttpException.php b/app/exception/HttpException.php new file mode 100644 index 0000000..e92d872 --- /dev/null +++ b/app/exception/HttpException.php @@ -0,0 +1,42 @@ + +// +---------------------------------------------------------------------- +declare (strict_types=1); + +namespace app\exception; + +use Exception; + +/** + * HTTP异常 + */ +class HttpException extends \RuntimeException +{ + private $statusCode; + private $headers; + + public function __construct(int $statusCode, string $message = '', $code = 0, array $headers = [], Exception $previous = null) + { + $this->statusCode = $statusCode; + $this->headers = $headers; + + parent::__construct($message, $code, $previous); + } + + public function getStatusCode() + { + return $this->statusCode; + } + + public function getHeaders() + { + return $this->headers; + } +} diff --git a/app/index/common.php b/app/index/common.php new file mode 100644 index 0000000..1243615 --- /dev/null +++ b/app/index/common.php @@ -0,0 +1,2 @@ + Request::class, + 'think\exception\Handle' => ExceptionHandle::class, //原系统 +]; diff --git a/app/service.php b/app/service.php new file mode 100644 index 0000000..db1ee6a --- /dev/null +++ b/app/service.php @@ -0,0 +1,9 @@ +=8.0.0", + "topthink/framework": "^8.0", + "topthink/think-orm": "^3.0", + "topthink/think-filesystem": "^2.0", + "topthink/think-multi-app": "^1.0", + "topthink/think-view": "^2.0" + }, + "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" + ] + } +} diff --git a/config/app.php b/config/app.php new file mode 100644 index 0000000..6dc02b7 --- /dev/null +++ b/config/app.php @@ -0,0 +1,33 @@ + env('APP_HOST', ''), + // 应用的命名空间 + 'app_namespace' => '', + // 是否启用路由 + 'with_route' => 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' => true, + +]; diff --git a/config/cache.php b/config/cache.php new file mode 100644 index 0000000..6b72dc8 --- /dev/null +++ b/config/cache.php @@ -0,0 +1,29 @@ + 'file', + + // 缓存连接方式配置 + 'stores' => [ + 'file' => [ + // 驱动方式 + 'type' => 'File', + // 缓存保存目录 + 'path' => '', + // 缓存前缀 + 'prefix' => '', + // 缓存有效期 0表示永久缓存 + 'expire' => 0, + // 缓存标签前缀 + 'tag_prefix' => 'tag:', + // 序列化机制 例如 ['serialize', 'unserialize'] + 'serialize' => [], + ], + // 更多的缓存连接 + ], +]; diff --git a/config/console.php b/config/console.php new file mode 100644 index 0000000..a818a98 --- /dev/null +++ b/config/console.php @@ -0,0 +1,9 @@ + [ + ], +]; diff --git a/config/cookie.php b/config/cookie.php new file mode 100644 index 0000000..d3b3aab --- /dev/null +++ b/config/cookie.php @@ -0,0 +1,20 @@ + 0, + // cookie 保存路径 + 'path' => '/', + // cookie 有效域名 + 'domain' => '', + // cookie 启用安全传输 + 'secure' => false, + // httponly设置 + 'httponly' => false, + // 是否使用 setcookie + 'setcookie' => true, + // samesite 设置,支持 'strict' 'lax' + 'samesite' => '', +]; diff --git a/config/database.php b/config/database.php new file mode 100644 index 0000000..1b9cb8a --- /dev/null +++ b/config/database.php @@ -0,0 +1,65 @@ + env('DB_DRIVER', 'mysql'), + + // 自定义时间查询规则 + 'time_query_rule' => [], + + // 自动写入时间戳字段 + // true为自动识别类型 false关闭 + // 字符串则明确指定时间字段类型 支持 int timestamp datetime date + 'auto_timestamp' => true, + + // 时间字段取出后的默认时间格式 + 'datetime_format' => 'Y-m-d H:i:s', + + // 时间字段配置 配置格式:create_time,update_time + 'datetime_field' => '', + + // 数据库连接配置信息 + 'connections' => [ + 'mysql' => [ + // 数据库类型 + 'type' => env('DB_TYPE', 'mysql'), + // 服务器地址 + 'hostname' => env('DB_HOST', '127.0.0.1'), + // 数据库名 + 'database' => env('DB_NAME', ''), + // 用户名 + 'username' => env('DB_USER', 'root'), + // 密码 + 'password' => env('DB_PASS', ''), + // 端口 + 'hostport' => env('DB_PORT', '3306'), + // 数据库连接参数 + 'params' => [], + // 数据库编码默认采用utf8 + 'charset' => env('DB_CHARSET', 'utf8mb4'), + // 数据库表前缀 + 'prefix' => env('DB_PREFIX', 'bmz_'), + + // 数据库部署方式: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, + ], + + // 更多的数据库配置信息 + ], +]; diff --git a/config/dictionary.php b/config/dictionary.php new file mode 100644 index 0000000..da15843 --- /dev/null +++ b/config/dictionary.php @@ -0,0 +1,75 @@ + 'ok', + '100' => '未知错误', + '101' => '数据不存在', + '102' => '站点不存在或已过期,请联系官方客服授权!!!', + '200' => 'ok', + '201' => '添加成功', + '202' => '添加失败', + '203' => '修改成功', + '204' => '修改失败或者没做任何修改', + '205' => '删除成功', + '206' => '删除失败', + '207' => '状态更改成功', + '208' => '状态更改失败', + '209' => '保存成功', + '210' => '保存失败', + '403' => '很抱歉您没有操作权限,请联系站点管理员!!!', + '500' => 'error', + '501' => 'error:Api控制器不存在', + '502' => 'error:Api方法不存在', + '40500' => '恭喜,登陆成功!!!', + '40501' => '用户名不正确!!!', + '40502' => '用户名不存在!!!', + '40503' => '该用户名已被禁用!!!', + '40504' => '密码不正确!!!', + '40505' => '未检测到正确的用户名!!!', + '40506' => '验证码不正确!!!', + '40507' => '密码错误次数过多,请半小时后重试或联系管理员!!!', + '40508' => '您的ip已被禁止访问,请联系管理员!!!', + '40509' => 'refresh_token已过期', + '40510' => 'token已过期', + '40511' => '您没有操作权限请联系站点管理员!!!', + '40512' => 'token无效或验证失败!!!', + //短信Api数据字典 + '40601' => '请输入正确的手机号!!!', + '40602' => '短信服务商数据不存在或被禁用!!!', + '40603' => '短信模板不存在或被禁用!!!', + '40604' => '请输入4位验证码!!!', + '40605' => '验证码不正确,请重新输入!!!', + + //数据库字典 + 'sqlfields' => [ + 'status' => [ + 0 => '禁用', + 1 => '启用', + ], + 'sex' => [ + 1 => '女', + 2 => '男' + ], + /*栏目类型*/ + 'column_type' => [ + 0 => '列表', + 1 => '单页', + 2 => '外部链接', + 3 => '留言板', + ], + /*广告类型*/ + 'ad_type' => [ + 0 => '固定广告', + 1 => '幻灯广告', + 2 => '对联广告', + 3 => '漂浮广告', + ], + + ], + 'upload' => [ + 'cdn_img_host' => 'http://xxxx.com/' + ], + + +]; diff --git a/config/filesystem.php b/config/filesystem.php new file mode 100644 index 0000000..582a8f8 --- /dev/null +++ b/config/filesystem.php @@ -0,0 +1,24 @@ + 'local', + // 磁盘列表 + 'disks' => [ + 'local' => [ + 'type' => 'local', + 'root' => app()->getRuntimePath() . 'storage', + ], + 'public' => [ + // 磁盘类型 + 'type' => 'local', + // 磁盘路径 + 'root' => app()->getRootPath() . 'public/storage', + // 磁盘路径对应的外部URL路径 + 'url' => '/storage', + // 可见性 + 'visibility' => 'public', + ], + // 更多的磁盘配置信息 + ], +]; diff --git a/config/lang.php b/config/lang.php new file mode 100644 index 0000000..0d8b693 --- /dev/null +++ b/config/lang.php @@ -0,0 +1,27 @@ + env('DEFAULT_LANG', 'zh-cn'), + // 允许的语言列表 + 'allow_lang_list' => [], + // 多语言自动侦测变量名 + 'detect_var' => 'lang', + // 是否使用Cookie记录 + 'use_cookie' => true, + // 多语言cookie变量 + 'cookie_var' => 'think_lang', + // 多语言header变量 + 'header_var' => 'think-lang', + // 扩展语言包 + 'extend_list' => [], + // Accept-Language转义为对应语言包名称 + 'accept_language' => [ + 'zh-hans-cn' => 'zh-cn', + ], + // 是否支持语言分组 + 'allow_group' => false, +]; diff --git a/config/log.php b/config/log.php new file mode 100644 index 0000000..4c2d0d7 --- /dev/null +++ b/config/log.php @@ -0,0 +1,45 @@ + 'file', + // 日志记录级别 + 'level' => [], + // 日志类型记录的通道 ['error'=>'email',...] + 'type_channel' => ['info'=>'email'], + // 关闭全局日志写入 + 'close' => false, + // 全局日志处理 支持闭包 + 'processor' => null, + + // 日志通道列表 + 'channels' => [ + 'file' => [ + // 日志记录方式 + 'type' => 'File', + // 日志保存目录 + 'path' => '', + // 单文件日志写入 + 'single' => false, + // 独立日志级别 + 'apart_level' => [], + // 最大日志文件数量 + 'max_files' => 0, + // 使用JSON格式记录 + 'json' => true, + // 日志处理 + 'processor' => null, + // 关闭通道日志写入 + 'close' => false, + // 日志输出格式化 + 'format' => '[%s][%s] %s', + // 是否实时写入 + 'realtime_write' => false, + ], + // 其它日志通道配置 + ], + +]; diff --git a/config/middleware.php b/config/middleware.php new file mode 100644 index 0000000..7e1972f --- /dev/null +++ b/config/middleware.php @@ -0,0 +1,8 @@ + [], + // 优先级设置,此数组中的中间件会按照数组中的顺序优先执行 + 'priority' => [], +]; diff --git a/config/route.php b/config/route.php new file mode 100644 index 0000000..2f4cd12 --- /dev/null +++ b/config/route.php @@ -0,0 +1,45 @@ + '/', + // 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_key' => 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', +]; diff --git a/config/session.php b/config/session.php new file mode 100644 index 0000000..c1ef6e1 --- /dev/null +++ b/config/session.php @@ -0,0 +1,19 @@ + 'PHPSESSID', + // SESSION_ID的提交变量,解决flash上传跨域 + 'var_session_id' => '', + // 驱动方式 支持file cache + 'type' => 'file', + // 存储连接标识 当type使用cache的时候有效 + 'store' => null, + // 过期时间 + 'expire' => 1440, + // 前缀 + 'prefix' => '', +]; diff --git a/config/trace.php b/config/trace.php new file mode 100644 index 0000000..fad2392 --- /dev/null +++ b/config/trace.php @@ -0,0 +1,10 @@ + 'Html', + // 读取的日志通道名 + 'channel' => '', +]; diff --git a/config/view.php b/config/view.php new file mode 100644 index 0000000..01259a0 --- /dev/null +++ b/config/view.php @@ -0,0 +1,25 @@ + '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' => '}', +]; diff --git a/extend/.gitignore b/extend/.gitignore new file mode 100644 index 0000000..c96a04f --- /dev/null +++ b/extend/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore \ No newline at end of file diff --git a/public/.htaccess b/public/.htaccess new file mode 100644 index 0000000..cbc7868 --- /dev/null +++ b/public/.htaccess @@ -0,0 +1,8 @@ + + Options +FollowSymlinks -Multiviews + RewriteEngine On + + RewriteCond %{REQUEST_FILENAME} !-d + RewriteCond %{REQUEST_FILENAME} !-f + RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L] + diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..3f2817f0665b40973f7004ea31b223e3a685c668 GIT binary patch literal 5434 zcmV-A6~*d_P)S}tzNYP79-gNL_t6i1tCE;*#d+> zX68Kij}S;gmN_$L&NBJE|7pma=Xrj-`t{+Nvph#3qBncw8AMXfLz!owReu!y(fV|h zJ_D^z26_TPpf_LuUpm^d9%yX(QP+X01HBuJFVK27ify1aq4g$$k-;e+U%*-7~ zFr0%{BSB{a!+?O>WwjAOvlgg8scN*jn1af!ZWraY?it{@w*@$`Z6pTcFu4xJ#cr1r zqgB8gDBhs4p^_;pLT(r2wC)q&qTC<@Bi|&zcr@37KE>^lY_`$>@iIZp!-)Kx$yFQNF2*W<1$fRiJqaCp0L4@w&FylMObB?IP>+Y1@@Ade z#YD>=0oEu=vcHePG&KF)E+@(D1od1N7Nk-NyN zUgvfpo$+pfi*kbu4o?Ms38cDRPB(P~tskZLzUkb)w$bfk+T+at&&;`ifSwKda<@wn z0IVURCU9r@2W}VAmbbpaYZRr~_Y*MRlkj@VMFey;C8K_T_SU55onlIJPeMm#gTB%2 zQbeczk2LOJLd9OU3jwbLxHNM(+ISHd>UJq2Dm5tcR`RNryIqL;ONf$Dg=nK139p|F zMjLNaoIT0y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`%fz)C%af5WRm zuLSivrZKi*!G?e z_CVVOstRqsg`vyXT=hYs-VrRC_+trCzdhfB;jIH!gI+=8jC~V4y#m0iXw9sQ#eO zK+_*(^h4`jKpK!v(T|TY6GMHDskc$z kXA?jE*Ad76z9MS>4;eE +// +---------------------------------------------------------------------- + +// [ 应用入口文件 ] +namespace think; + +require __DIR__ . '/../vendor/autoload.php'; + +// 执行HTTP应用并响应 +$http = (new App())->http; + +$response = $http->run(); + +$response->send(); + +$http->end($response); diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 0000000..eb05362 --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Disallow: diff --git a/public/router.php b/public/router.php new file mode 100644 index 0000000..9b39a62 --- /dev/null +++ b/public/router.php @@ -0,0 +1,19 @@ + +// +---------------------------------------------------------------------- +// $Id$ + +if (is_file($_SERVER["DOCUMENT_ROOT"] . $_SERVER["SCRIPT_NAME"])) { + return false; +} else { + $_SERVER["SCRIPT_FILENAME"] = __DIR__ . '/index.php'; + + require __DIR__ . "/index.php"; +} diff --git a/public/static/.gitignore b/public/static/.gitignore new file mode 100644 index 0000000..c96a04f --- /dev/null +++ b/public/static/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore \ No newline at end of file diff --git a/route/app.php b/route/app.php new file mode 100644 index 0000000..3b4aefe --- /dev/null +++ b/route/app.php @@ -0,0 +1,13 @@ + +// +---------------------------------------------------------------------- +use think\facade\Route; + + diff --git a/runtime/temp/76f9cf949a2861fa62a30ddee32bbbd0.php b/runtime/temp/76f9cf949a2861fa62a30ddee32bbbd0.php new file mode 100644 index 0000000..304b036 --- /dev/null +++ b/runtime/temp/76f9cf949a2861fa62a30ddee32bbbd0.php @@ -0,0 +1,11 @@ + + + + + + Title + + +[自定义404] + + \ No newline at end of file diff --git a/think b/think new file mode 100644 index 0000000..2429d22 --- /dev/null +++ b/think @@ -0,0 +1,10 @@ +#!/usr/bin/env php +console->run(); \ No newline at end of file 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