| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- <?php
- namespace pt\controllers;
- use common\components\util;
- use Yii;
- use common\services\xhWxOpenAdminService;
- class MainController extends PlatformController
- {
- public $guestAccess = ['login', 'logout', 'check-login', 'index'];
- public function actionApp()
- {
- return $this->render('app');
- }
- public function actionIndex()
- {
- $host = Yii::$app->request->getHostInfo();
- $name = '花掌柜';
- $bei = '闽ICP备15017325号-1';
- if (strstr($host, 'hzghd') !== false) {
- $name = '花掌柜';
- $bei = '闽ICP备15017325号-1';
- }
- if (strstr($host, 'theflorist') !== false) {
- $name = '花掌柜';
- $bei = '闽ICP备15017325号-2';
- }
- if (strstr($host, 'huaml') !== false) {
- $name = '花美利';
- $bei = '闽ICP备15017325号-3';
- }
- if (strstr($host, 'zhhinc') !== false) {
- $name = '中花汇';
- $bei = '闽ICP备15017325号-4';
- }
- if (strstr($host, 'huahb.com') !== false) {
- $name = '花掌柜';
- $bei = '闽ICP备15017325号-5';
- }
- if (strstr($host, 'huahb.cn') !== false) {
- $name = '花掌柜';
- $bei = '闽ICP备15017325号-6';
- }
- if (strstr($host, 'zhiguanhua.cn') !== false) {
- $name = '花掌柜';
- $bei = '闽ICP备15017325号-7';
- }
- if (strstr($host, 'huadianbao.net') !== false) {
- $name = '花掌柜';
- $bei = '闽ICP备15017325号-8';
- }
- if (strstr($host, 'wixhb.com') !== false) {
- $name = '销花宝';
- $bei = '闽ICP备15017325号-9';
- }
- if (strstr($host, 'wixhb.cn') !== false) {
- $name = '花掌柜';
- $bei = '闽ICP备15017325号-10';
- }
- $this->layout = false;
- return $this->render('index', ['name' => $name, 'bei' => $bei]);
- }
- 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');
- }
- }
|