摘要: class File{ static function image($file) { validate(['image'=>'fileSize:5242880|fileExt:jpg']) ->check(['image'=>$file]); $savename = \think\facade\Fi 阅读全文
posted @ 2022-03-06 20:20 南瓜不能吃 阅读(246) 评论(0) 推荐(0)
摘要: TP5下载: composer require topthink/think-migration=1.0.* 2.创建迁移文件php think migrate:create Users 3.编辑文件 public function change() { // create the table $t 阅读全文
posted @ 2022-03-06 19:50 南瓜不能吃 阅读(71) 评论(0) 推荐(0)
摘要: 第一步 安装 composer create-project topthink/think exam 注意:切换到项目目录 cd exam 第二步: 安装多应用 composer require topthink/think-multi-app 第三步 配置域名 通过phpstudy配置虚拟域名 e 阅读全文
posted @ 2022-02-08 20:29 南瓜不能吃 阅读(328) 评论(0) 推荐(0)
摘要: 安装 composer require phpoffice/phpspreadsheet 2.建立封装类Excel.php 封装方法如下: <?php //根据自己的文件位置更改命名空间 namespace app\admin\library; use PhpOffice\PhpSpreadshee 阅读全文
posted @ 2022-01-08 18:53 南瓜不能吃 阅读(1097) 评论(0) 推荐(0)
摘要: class Check{ public function handle($request, \Closure $next) { $token = $request->get('token');// print_r($token);die(); if (empty($token)) { echo 't 阅读全文
posted @ 2021-12-30 13:12 南瓜不能吃 阅读(287) 评论(0) 推荐(0)
摘要: //controller /** * 显示结算页面 * * @return \think\Response */ public function create() { //登录检测 if(!session('?user_info')){ //没有登录 跳转到登录页面 //设置登录成功后的跳转地址 / 阅读全文
posted @ 2021-12-30 12:51 南瓜不能吃 阅读(90) 评论(0) 推荐(0)
摘要: 控制层/加入购物车 表单提交 public function addcart() {// if(request()->isGet()){// //如果是get请求 跳转到首页// $this->redirect('home/index/index');// } //接收数据 $params = in 阅读全文
posted @ 2021-12-30 12:49 南瓜不能吃 阅读(118) 评论(0) 推荐(0)
摘要: 在Base层: <?phpdeclare (strict_types=1);namespace app\home\controller;use app\BaseController;use app\brand\model\Category;use think\App;use think\facade 阅读全文
posted @ 2021-12-30 12:37 南瓜不能吃 阅读(243) 评论(0) 推荐(0)
摘要: JWT composer 安装 composer require lcobucci/jwt 3.3 在extend/tools/jwt创建Token.php注意:如果没有该目录,则自行创。 生成Token(createToken) <?phpnamespace tools\jwt; use Lcob 阅读全文
posted @ 2021-12-19 23:51 南瓜不能吃 阅读(75) 评论(0) 推荐(0)
摘要: 腾讯云、七牛云对象存储的工具类 An SDK integrating Tencent cloud and qiniu cloud object storage 安装(Installation) composer require lorine/oss-utils 腾讯云、七牛云对象存储的工具类 An 阅读全文
posted @ 2021-12-19 23:46 南瓜不能吃 阅读(124) 评论(0) 推荐(0)