Package Data | |
---|---|
Maintainer Username: | zhangkexiang |
Maintainer Contact: | zhangkexiang@qingdao1024.com (coding) |
Package Create Date: | 2016-12-27 |
Package Last Update: | 2017-01-17 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-10-30 15:05:24 |
Package Statistics | |
---|---|
Total Downloads: | 76 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 0 |
Total Watchers: | 1 |
Total Forks: | 0 |
Total Open Issues: | 0 |
laravel开发 常用中间件
配置:
config/union.php
不对 test/mid进行校验的配置
<?php
return [
'mid'=>[
'excepturl'=>[
// 'test/mid'
],
'sign'=>[
'secret'=>[
'android'=>[
'first'=>'11111111111111111111',
'second'=>'22222222222222222222'
],
'ios'=>[
'first'=>'33333333333333333333',
'second'=>'44444444444444444444'
]
],
'headers'=>[
'uid'
]
]
]
];
Kernel.php 匹配签名校验
<?php
namespace App\Http;
use Illuminate\Foundation\Http\Kernel as HttpKernel;
class Kernel extends HttpKernel
{
protected $middleware = [
\Union\Mid\CheckSignMiddleware::class
];
protected $routeMiddleware = [
];
}
签名验证规则: 从header中取