| 123456789101112131415161718192021222324252627282930313233343536373839 |
- <?php
- namespace mobile\controllers;
- use biz\user\services\UserService;
- use common\components\jwt;
- use common\components\token;
- use Yii;
- use yii\db\Exception;
- use yii\web\Controller;
- class MainController extends PublicController
- {
-
- public $enableCsrfValidation = false;
- public function actionIndex()
- {
- $host = Yii::$app->request->getHostInfo();
- $fullUrl = Yii::$app->request->url;
- $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]);
- }
- public function actionJwt()
- {
- echo jwt::create(1,12536630);
- }
-
- }
|