tp6对接微信时,有返回的echostr这个,却依然提示token验证失败

首页 / php框架 / 正文

查看http请求日志后发现,当微信请求验证方法,响应状态是200正常的,但是他却多返回了一些东西。
返回结果片段:

6742117613320069073<div id="think_page_trace" style="position: fixed;bottom:0;right:0;font-size:14px;width:100%;z-index: 999999;color: #000;text-align:left;font-family:'微软雅黑';">
    <div id="think_page_trace_tab" style="display: none;background:white;margin:0;height: 250px;">
        <div id="think_page_trace_tab_tit" style="height:30px;padding: 6px 12px 0;border-bottom:1px solid #ececec;border-top:1px solid #ececec;font-size:16px">
                        <span style="color:#000;padding-right:12px;height:30px;line-height:30px;display:inline-block;margin-right:3px;cursor:pointer;font-weight:700">基本</span>
                        <span style="color:#000;padding-right:12px;height:30px;line-height:30px;display:inline-block;margin-right:3px;cursor:pointer;font-weight:700">文件</span>
                        <span style="color:#000;padding-right:12px;height:30px;line-height:30px;display:inline-block;margin-right:3px;cursor:pointer;font-weight:700">流程</span>
                        <span style="color:#000;padding-right:12px;height:30px;line-height:30px;display:inline-block;margin-right:3px;cursor:pointer;font-weight:700">错误</span>

div所包裹的东西就是tp的Trace调试
有两种解决办法,一种是关闭调试模式,但如果在开发过程中想用这个调试模式在办呢,所以就有下边这种方式。直接echo echostr;

    /**
     * 接收微信返回信息入口
     */
    public function connector()
    {
        if (!input('get.echostr')) {
            $this->responeMsg(); // 处理微信返回的其他的信息
            exit;
        }
        if ($this->checkSignature()) {
            echo $_GET['echostr'];
        } else {
            return '发生了一些错误';
        }
        exit;
    }
打赏
评论区
头像