随笔分类 - thinkphp
thinkphp
摘要:一,extend目录的功能: extend目录可以存放自己所开发的具备通用功能的类, vendor目录存放的是通过composer下载的第三方库 注意与app目录下的内容区分 说明:刘宏缔的架构森林是一个专注架构的博客, 网站:https://blog.imgtouch.com本文: https:/
阅读全文
摘要:一,编写php代码 1,config/errorMsg.php 代码: <?php //user define('USER_NOT_EXIST', ['code'=>1001,'msg'=>'用户不存在']); define('USER_NOT_ACTIVE', ['code'=>1002,'msg
阅读全文
摘要:一,系统配置 .env 中配置redis [REDIS0] TYPE = redis HOST = 127.0.0.1 PORT = 6379 PASSWORD = 说明:刘宏缔的架构森林是一个专注架构的博客, 网站:https://blog.imgtouch.com本文: https://blog
阅读全文
摘要:一,从命令行创建用到的类: liuhongdi@lhdpc:/data/php/admapi$ php think make:controller Goods Controller:app\controller\Goods created successfully. liuhongdi@lhdpc:
阅读全文
摘要:一,创建middelware和controller liuhongdi@lhdpc:/data/php/admapi$ php think make:middleware CheckSign Middleware:app\middleware\CheckSign created successful
阅读全文
摘要:一,安装mpdf库 1,用composer安装: liuhongdi@lhdpc:/data/php/admapi$ composer require mpdf/mpdf 2, 查看已安装库的版本: liuhongdi@lhdpc:/data/php/admapi$ composer show mp
阅读全文
摘要:一,编写php代码 1,lib/util/zip.php <?php namespace app\lib\util; class zip { //打包一个zip文件 public function makeZip($pathArr,$zipName) { $zip = new \ZipArchive
阅读全文
摘要:一,安装ImageMagick库: 1,apt-get安装 root@lhdpc:~# apt-get install imagemagick 2,查看版本: root@lhdpc:~# convert --version Version: ImageMagick 6.9.11-60 Q16 x86
阅读全文
摘要:一,安装phpshpreadsheet 1,composer安装 liuhongdi@lhdpc:~$ cd /data/php/admapi/ liuhongdi@lhdpc:/data/php/admapi$ composer require phpoffice/phpspreadsheet 2
阅读全文
摘要:一,创建过滤IP的中间件 1,创建: liuhongdi@lhdpc:/data/php/admapi$ php think make:middleware CheckIp Middleware:app\middleware\CheckIp created successfully. 2,代码: m
阅读全文
摘要:一,thinkphp6配置强制路由: 1,修改config/route.php 设置url_route_must一项的值为true 如下: // 是否强制使用路由 //'url_route_must' => false, 'url_route_must' => true, 2,查看修改后的效果: 访
阅读全文
摘要:一,qr-code代码库的地址: https://github.com/endroid/qr-code 说明:刘宏缔的架构森林是一个专注架构的博客, 网站:https://blog.imgtouch.com本文: https://blog.imgtouch.com/index.php/2023/05
阅读全文
摘要:一,编写php代码: 1,创建写日志的middleware: liuhongdi@lhdpc:/data/php/admapi$ php think make:middleware AdminLog Middleware:app\middleware\AdminLog created success
阅读全文
摘要:一,使用bcrypt实现加密和验证的php代码: class Auth extends BaseController { /* *测试用bcrypt方式验证密码 * *@return \think\Response * */ public function testPass() { //原始密码 $
阅读全文
摘要:一,访问yac的php代码: 1,创建controller liuhongdi@lhdpc:/data/php/admapi$ php think make:controller Yac Controller:app\controller\Yac created successfully. 2,co
阅读全文
摘要:一,安装firebase/php-jwt扩展: 1,命令: liuhongdi@lhdpc:/data/php/admapi$ composer require firebase/php-jwt 2,安装成功后的位置: 3,查看firebase/php-jwt的版本: liuhongdi@lhdpc
阅读全文
摘要:一,vue前端代码 1,Login.vue <template> <div style="padding:20px;display: flex;align-items:center;justify-content: center;"> <form :model="account" style="ma
阅读全文
摘要:一,创建command 1,创建command liuhongdi@lhdpc:/data/php/admapi$ php think make:command SetOrderStatus setorderstatus Command:app\command\SetOrderStatus crea
阅读全文
摘要:一,查看线上所有的库: liuhongdi@lhdpc:/data/php/admapi$ composer show --all 查询时间较长,一般不必要 说明:刘宏缔的架构森林是一个专注架构的博客, 网站:https://blog.imgtouch.com本文: https://blog.img
阅读全文
摘要:一,创建一个order类,在其中应用事务 1,创建order的model liuhongdi@lhdpc:/data/php/admapi$ php think make:model Order Model:app\model\Order created successfully. 2,代码: mo
阅读全文