12345678910111213141516171819202122232425262728293031323334353637 |
- <?php
- /**
- * Created by PhpStorm.
- * User: Bear
- * Date: 2020/2/3
- * Time: 下午5:29
- */
- namespace app\index\controller;
- use app\common\controller\Frontend;
- use app\common\library\Ip;
- use app\common\library\Redis;
- use app\common\service\DesService;
- use app\main\constants\CacheConstants;
- use app\main\service\AdminService;
- use app\main\service\LogService;
- class Guidewxsubscribe extends Frontend
- {
- public function index()
- {
- $channel_id = DesService::instance()->decode($this->request->get('token'));
- $ip = Ip::ip();
- $key = CacheConstants::getGuideWxSubscribe($ip, $_SERVER['HTTP_USER_AGENT']);
- if (isset($_SERVER['HTTP_REFERER'])) {
- $url = $_SERVER['HTTP_REFERER'];
- Redis::instance()->set($key, $url, 600);
- LogService::info('GWS:REF:' . $ip . ':' . $url);
- } else {
- LogService::notice('GWS:NOREF:' . $ip);
- }
- $adminInfo = AdminService::instance()->getAdminConfigModel()->getAdminInfoAll($channel_id);
- return $this->assign('data', $adminInfo['json']['authorizer_info'])->view->fetch();
- }
- }
|