代码拉取完成,页面将自动刷新
常用工具
composer require liguangchun/tool
composer update liguangchun/tool
composer remove liguangchun/tool
composer search liguangchun/tool
use liguangchun\tool\MiniProgramAes;
class Index
{
public function index()
{
// 配置key和iv
$aes = new MiniProgramAes('7324564123567898', '7324564173265898');
// 加密 自动识别是array还是字符串
var_dump($aes->encrypt('1111'));
// 解密
var_dump($aes->decrypt('J42UtufU8075QPbq0%2FQIqA%3D%3D'));
}
}
use liguangchun\tool\Ret;
class Index
{
public function index()
{
// 返回成功Json
Ret::jsonSuccess(['id'=>1]);
// 返回错误Json
Ret::jsonError('错误描述', 1);
}
}
use liguangchun\tool\Req;
class Index
{
public function index()
{
// 判断输入的参数 有空值就返回false 下面示例是使用TP框架
Req::isEmpty(Request::only($arr, 'get'),['id']);
// 判断输入的参数 有空值就输出Json错误 下面示例是使用TP框架
Req::isEmptyRet(Request::only($arr, 'get'),['id']);
// 判断请求是否为GET true 是 ; false 否
Ret::isGet();
// 判断请求是否为GET true 是 ; false 否
Ret::isPost();
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。