|
|
@@ -12,12 +12,21 @@ class MainController extends PublicController
|
|
|
{
|
|
|
|
|
|
public $enableCsrfValidation = false;
|
|
|
-
|
|
|
+
|
|
|
public function actionIndex()
|
|
|
{
|
|
|
$host = Yii::$app->request->getHostInfo();
|
|
|
$fullUrl = Yii::$app->request->url;
|
|
|
- $token = strpos($fullUrl, 'token') === false ? '' : 'hasToken';
|
|
|
+ $token = '';
|
|
|
+ if(strpos($fullUrl, 'token')){
|
|
|
+ $parse = parse_url($fullUrl);
|
|
|
+ if (isset($parse['query'])) {
|
|
|
+ parse_str($parse['query'], $queryArray);
|
|
|
+ if (isset($queryArray['token']) && !empty($queryArray['token'])) {
|
|
|
+ $token = $queryArray['token'];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
return $this->renderPartial('index', ['host' => $host, 'token' => $token]);
|
|
|
}
|
|
|
|