| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <?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()
- {
- if ($this->isLogin) {
- $this->redirect(['main/index']);
- Yii::$app->end();
- }
- return $this->renderPartial('login');
- }
-
- /**
- * 重复登陆,记录登陆名
- */
- public function actionRelogin()
- {
- return $this->renderPartial('relogin');
- }
-
- 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');
- }
-
- }
|