123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <?php
- namespace app\admin\controller;
- use app\BaseController;
- use app\common\model\base\msg\Notice;
- use upload\Uploader;
- class Index extends BaseController
- {
- public function index()
- {
- $url = request()->domain().'/admin/#/applyNav';
- header("Location: $url");
- }
- /**
- * @title: 公众号事件接收
- * @desc: 描述
- * @return {*}
- * @author: Rock
- * @method: POST
- * @Date: 2023-04-07 16:06:11
- */
- public function WxSubEvent()
- {
- $url = 'http://iddserver.app2.hbdrwh.cn/admin/index/WxSubEvent';
- $wx = new \weixin\Wx;
- $res = $wx->WxEvent(0);// 在公众平台设置时,传参数1,设置完成后改为0
- return response($res)->header([
- 'Content-Type' => 'text/plain;charset=utf-8'
- ]);
- }
- /**
- * @title: 测试向微信公众号发送消息
- * @desc: 描述
- * @return {*}
- * @author: Rock
- * @method: POST
- * @Date: 2023-04-07 17:47:31
- */
- public function WxSubTestMsg()
- {
- $tpl_id = "MPTRdM8KQ1-eDMNuBs0lhcxsLiK-3qTbju_hpHFZX48";
- $res = Notice::sendWx(1,['闫石',18,'男'],$tpl_id);
- WLog('WxSubTestMsg',json_encode($res));
- return json($res);
- }
- }
|