1234567891011121314151617181920212223242526272829303132 |
- <?php
- /**
- * Author: luzheng.liu
- * Time: 2020/12/5 17:55
- */
- namespace app\index\controller;
- use app\common\service\CommonService;
- class Index {
- public function index() {
- $visitorId = input('visitorId');
- $notifyUrl = input('notify_url');
- if (empty(session('unionid'))){
- // header("Location:".CommonService::getAuthUrl());
- header("Location:http://mdttest.kydev.net/api/wechat/focusarea/11/28?redirecturi=https://webcast.bizconfstreaming.com/index/user/login");
- return;
- }
- //增加客户自己的验证逻辑,例如登录,关注,付费,填手机号等
- $key = md5($visitorId.CommonService::getAuthKey());
- if(strpos($notifyUrl,'?') !== false){//url参数处理,将key加到url参数中
- $returnUrl = $notifyUrl."&key=".$key."&expire=3600";
- }else{
- $returnUrl = $notifyUrl."?key=".$key."&expire=3600";
- }
- header("Location:".$returnUrl.'&a='.session('unionid'));//跳转到直播观看页
- // redirect($returnUrl);
- }
- }
|