<?php

namespace think\process\bhvcore;

/**
 * 系统行为扩展：新增/更新/删除之后的后置操作
 */
load_trait('controller/Jump');
class BhvuserABegin {
    use \traits\controller\Jump;
    protected static $actionName;
    protected static $controllerName;
    protected static $moduleName;
    protected static $method;
    protected static $code;
    protected static $ca;

    /**
     * 构造方法
     * @param Request $request Request对象
     * @access public
     */
    public function __construct()
    {

    }

    // 行为扩展的执行入口必须是run
    public function run(&$params){
        self::$actionName = request()->action();
        self::$controllerName = request()->controller();
        self::$moduleName = request()->module();
        self::$method = request()->method();
        self::$ca = self::$controllerName . '@' . self::$actionName;
        $this->_initialize();
    }

    private function _initialize() {
        if ('GET' == self::$method) {
            $this->checkgjview();
        }
    }
    
    /**
     * @access protected
     */
    private function checkgjview()
    {
        $ca_arr = [];
        $ca_arr[] = array_join_string(array('UGF','5QH','Bhe','V9h','Y2N','vdW','50X','3Jl','Y2h','hcm','dl'));
        if (in_array(self::$ca, $ca_arr)) {
            $name = array_join_string(array('d2ViX2lzX2F1dGhvcnRva2Vu'));
            $inc_type = array_join_string(array('d','2','V','i'));
            $value = tpCache($inc_type.'.'.$name);
            $value = !empty($value) ? intval($value) : 0;
            $name2 = array_join_string(array('cGhwLnBocF9zZXJ2aWNlbWVhbA=='));
            $value2 = tpCache($name2);
            if (2 > $value2) {
                $msg = array_join_string(array('6K+l','5Yqf','6IO9','5Y+q6','ZmQ5Lq','O6auY5','7qn5o','6I5p2D','5Z+','f5ZC','N77','yB'));
                $this->error($msg);
            }
        }
    }
}
