getting the details of the user indicates that 40163 error code has been used, but I have not stored or used code. This error occurs every time, and it has not been successfully authorized. And this page will appear when calling the callback function getDetailInfo. I don"t see if anyone else"s =
.  
 
Code
public function getUserDetail(){
        $appid="wxccc324b35ed44896";
        $redirect_uri=urlencode("http://flowerwithpiggy.duapp.com/index.php/Weixin/getDetailInfo");
        $url="https://open.weixin.qq.com/connect/oauth2/authorize?appid=".$appid."&redirect_uri=".$redirect_uri."&response_type=code&scope=snsapi_userinfo&state=123-sharpwechat_redirect";
        //
        header("location:".$url);
    }
    /**
     * access_token
     * @return [type] [description]
     */
    public function getDetailInfo(){
        $appid="wxccc324b35ed44896";
        $secret="a23db7dedbdab946f473e26d07199f6e";
        $code=$_GET["code"];
        $url="https://api.weixin.qq.com/sns/oauth2/access_token?appid=".$appid."&secret=".$secret."&code=".$code."&grant_type=authorization_code";
        $res=$this->http_curl($url);
        // if($res["errcode"]){
        // }
        $access_token=$res["access_token"];
        var_dump($res);
        $openid=$res["openid"];
        $url="https://api.weixin.qq.com/sns/userinfo?access_token=".$access_token."&openid=".$openid."&lang=zh_CN";
        $res=$this->http_curl($url);
        var_dump($res);
    }