You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- <?php
- /**
- * Created by PhpStorm.
- * User: admin
- * Date: 2017/6/7
- * Time: 10:29
- */
-
- namespace common\Controller;
-
- use common\service\admin\LoginService;
- use yii;
- use yii\web\Controller;
-
- class AdminController extends Controller
- {
- public $service;
-
- /**
- * Des:校验是否登录
- * Name: beforeAction
- * @param yii\base\Action $action
- * @return bool
- * @author 倪宗锋
- */
- public function beforeAction($action)
- {
- $checkLogin = LoginService::checkLogin();
- if ($checkLogin['flag'] == false) {
- Yii::$app->response->format = 'json';
- Yii::$app->response->data = $checkLogin;
- return false;
- }
- $_COOKIE['admin_uid'] = LoginService::$uid;
- return true;
- }
- }
|