| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <?php
- namespace saas\controllers;
- use common\components\configDict;
- use common\components\util;
- use Yii;
- use yii\web\Controller;
- use yii\filters\AccessControl;
- use common\services\xhWxOpenAdminService;
- class MainController extends PlatformController
- {
-
- public $withoutLogin = ['login', 'logout', 'check-login'];
-
- public function actionIndex()
- {
- return $this->render('index');
- }
-
- public function actionLogin()
- {
- Yii::$app->end();
- }
- public function actionRelogin()
- {
- }
-
- public function actionLogout()
- {
- xhWxOpenAdminService::logout();//不注销所有的 用户会话数据
- $this->redirect(['main/login']);
- }
-
- public function actionCheckLogin()
- {
- $request = Yii::$app->request;
- $mobile = $request->post('mobile');
- $password = $request->post('password');
- $return = xhWxOpenAdminService::loginByMobile($mobile, $password, true);//true 自动登陆
- if ($return) {
- util::complete('success');
- }
- util::fail('帐号或密码错误');
- }
-
- public function actionRunning()
- {
- return $this->render('running');
- }
-
- public function actionBook()
- {
- return $this->render('book');
- }
-
- }
|