1. 程式人生 > >弱小和無知不是生存的障礙 傲慢才是!

弱小和無知不是生存的障礙 傲慢才是!

這個外掛是 開放平臺的掃碼登入 如果微信裡面要用的話 需要修改如下檔案
/assets/forum-9c15ade4.js
最後新增
$(function () {
    if(window.location.href.indexOf("wechat_user") != -1){
        var log=JSON.parse(decodeURIComponent(window.location.href.split("=")[1]));
        window.app.authenticationComplete(log);
    }
});
/vendor/flarum/core/src/Forum/AuthenticationResponseFactory.php
getResponse 方法 修改為
 private function getResponse(array $payload)
    {
//        print_r(json_encode($payload));die();
//        $content = sprintf(
//            '<script>window.opener.app.authenticationComplete(%s); window.close();</script>',
//            json_encode($payload)
//        );
        $content = sprintf(
            '<script>
                        window.location.href="http://www.jdaile.com/?&wechat_user="+encodeURIComponent(JSON.stringify(%s));
                    </script>',
            json_encode($payload)

        );

        return new HtmlResponse($content);
    }