| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- <?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::successInfo('success');
- }
- util::failInfo('帐号或密码错误');
- }
-
- public function actionRunning()
- {
- return $this->render('running');
- }
-
- public function actionBook()
- {
- return $this->render('book');
- }
- }
|