zhangkexiang / union-middleware by zhangkexiang

Laravel dev middleware util
77
0
1
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-11-14 15:05:15
Package Statistics
Total Downloads: 77
Monthly Downloads: 1
Daily Downloads: 1
Total Stars: 0
Total Watchers: 1
Total Forks: 0
Total Open Issues: 0

union-middlware

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中取