zhangkexiang / union-middleware by zhangkexiang

Laravel dev middleware util
80
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-12-22 03:04:50
Package Statistics
Total Downloads: 80
Monthly Downloads: 2
Daily Downloads: 0
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中取