url($url); \app\main\service\UserService::instance()->getRunTimeObject()->urlType = \app\main\constants\OpenPlatformConstants::URL_TYPE_SPREAD; //var_dump(\app\main\service\UserService::instance()->getUserInfo()); $_SERVER['HTTP_X_REWRITE_URL'] = $url; $_SERVER['HTTP_X_REAL_HOST'] = 'wx7610e3344bdea6f6.dev.kpread.com'; echo UrlService::instance()->unlimitSecondaryDomain()->data; } /** * 检查域名是入口域名 * @return bool */ public function testDomainIsReferral() { //$host = get_host_no_port(); $host = "wx7610e3344bdea6f6.dev.kpread.com"; //$host = "px-3c517-wx7610e3344bdea6f6-20000039-f509f.dev.kpread.com/"; if(preg_match("/^wx\w+/i", $host, $matches)){ $res = $matches[0]; //return ; } if(preg_match("/^px-\w{5}-(wx\w+)-/i", $host, $matches)){ $res = $matches[1]; //return; } echo $res; } }