Index.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. namespace app\admin\controller;
  3. use app\BaseController;
  4. use app\common\model\base\msg\Notice;
  5. use upload\Uploader;
  6. class Index extends BaseController
  7. {
  8. public function index()
  9. {
  10. $url = request()->domain().'/admin/#/applyNav';
  11. header("Location: $url");
  12. }
  13. /**
  14. * @title: 公众号事件接收
  15. * @desc: 描述
  16. * @return {*}
  17. * @author: Rock
  18. * @method: POST
  19. * @Date: 2023-04-07 16:06:11
  20. */
  21. public function WxSubEvent()
  22. {
  23. $url = 'http://iddserver.app2.hbdrwh.cn/admin/index/WxSubEvent';
  24. $wx = new \weixin\Wx;
  25. $res = $wx->WxEvent(0);// 在公众平台设置时,传参数1,设置完成后改为0
  26. return response($res)->header([
  27. 'Content-Type' => 'text/plain;charset=utf-8'
  28. ]);
  29. }
  30. /**
  31. * @title: 测试向微信公众号发送消息
  32. * @desc: 描述
  33. * @return {*}
  34. * @author: Rock
  35. * @method: POST
  36. * @Date: 2023-04-07 17:47:31
  37. */
  38. public function WxSubTestMsg()
  39. {
  40. $tpl_id = "MPTRdM8KQ1-eDMNuBs0lhcxsLiK-3qTbju_hpHFZX48";
  41. $res = Notice::sendWx(1,['闫石',18,'男'],$tpl_id);
  42. WLog('WxSubTestMsg',json_encode($res));
  43. return json($res);
  44. }
  45. }