Index.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /**
  3. * Author: luzheng.liu
  4. * Time: 2020/12/5 17:55
  5. */
  6. namespace app\index\controller;
  7. use app\common\service\CommonService;
  8. class Index {
  9. public function index() {
  10. $visitorId = input('visitorId');
  11. $notifyUrl = input('notify_url');
  12. var_dump(input());
  13. var_dump($_SESSION);
  14. die();
  15. if (empty(session('unionid'))){
  16. header("Location:".CommonService::getAuthUrl());
  17. // redirect(CommonService::getAuthUrl());
  18. die();
  19. }
  20. //增加客户自己的验证逻辑,例如登录,关注,付费,填手机号等
  21. $key = md5($visitorId.CommonService::getSetData()['channel_auth_code']);
  22. if(strpos($notifyUrl,'?') !== false){//url参数处理,将key加到url参数中
  23. $returnUrl = $notifyUrl."&key=".$key."&expire=3600";
  24. }else{
  25. $returnUrl = $notifyUrl."?key=".$key."&expire=3600";
  26. }
  27. header("Location:".$returnUrl);//跳转到直播观看页
  28. // redirect($returnUrl);
  29. }
  30. }