| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- <?php
- namespace pt\controllers;
- use biz\pt\classes\AgreementClass;
- use common\components\util;
- use Yii;
- use common\services\xhWxOpenAdminService;
- class MainController extends PlatformController
- {
- public $guestAccess = ['login', 'logout', 'check-login', 'index', 'app', 'xhb-privacy', 'xhb-register', 'xhb-user-privacy','hzg-privacy', 'hzg-register'];
- public function actionApp()
- {
- return $this->renderPartial('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');
- }
- //隐私协议
- public function actionXhbPrivacy()
- {
- AgreementClass::xhbPrivacy();
- exit();
- }
- //隐私协议(OPPO隐私协议链接改了之后此方法可删)
- public function actionXhbUserPrivacy()
- {
- AgreementClass::xhbPrivacy();
- exit();
- }
- //服务协议
- public function actionXhbRegister()
- {
- AgreementClass::xhbRegister();
- exit();
- }
- public function actionHzgPrivacy()
- {
- AgreementClass::hzgPrivacy();
- exit();
- }
- public function actionHzgRegister()
- {
- AgreementClass::hzgRegister();
- exit();
- }
- }
|