7月12日芸众微擎研究

 

 

复制代码
        

        //执行方法 $controller->preAction(); if (method_exists($controller, 'needTransaction') && $controller->needTransaction($action)) { // action设置了需要回滚 $content = \Illuminate\Support\Facades\DB::transaction(function () use ($action, $controller) { return $controller->$action( Illuminate\Http\Request::capture() ); }); } else { $content = $controller->$action( Illuminate\Http\Request::capture() ); } exit($content);
复制代码

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
/**
 * 前置action
 */
public function preAction()
{
    //strpos(request()->get('route'),'setting.key')!== 0 && Check::app();
 
    //是否为商城后台管理路径
    if (env('APP_Framework') == 'platform') {
        strpos(request()->getRequestUri(),  config('app.isWeb')) === 0 && Check::setKey();
    } else {
        strpos(request()->getBaseUrl(),  '/web/index.php') === 0 && Check::setKey();
    }
}

  

posted @   归一山人  阅读(245)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示