Session::get('wxId'), 'channel_id' => $channelId])->find(); if (empty(Session::get('wxId')) || empty($info)){ Cache::set(Session::get('wxId'), ''); header("Location:".CommonService::getAuthUrl($channelId)); die(); } if (empty(Cache::get(Session::get('wxId')))) { Cache::set(Session::get('wxId'), $visitorId); } $visitorId = Cache::get(Session::get('wxId')); // $params = [ // 'id' => $info['channel_id'], // 'userid' => $info['unionid'], // 'name' => $info['nickName'], // 'avatar' => $info['avatar'], // 'key' => $info['key'] // ]; // header('Location:http://mudu.tv/activity.php?a=userAssign&'.http_build_query($params)); // die(); //增加客户自己的验证逻辑,例如登录,关注,付费,填手机号等 $key = md5($visitorId.$data['channel_auth_code']); if(strpos($notifyUrl,'?') !== false){//url参数处理,将key加到url参数中 $returnUrl = $notifyUrl."&key=".$key."&expire=3600"; }else{ $returnUrl = $notifyUrl."?key=".$key."&expire=3600"; } header("Location:".$returnUrl);//跳转到直播观看页 // redirect($returnUrl); } }