微信 error:40163 code been used EasyWeChat

直接判断有没有code就可以 基本代码贴上

 public function index(Request $request)
    {
        $user = session('user');//用户资料
        if(empty($user))
        {
            $response =  $this->wechat->oauth->scopes(['snsapi_base'])->redirect();
            return $response;
        }else{
            dd($user);
        }
    }
    public function login(Request $request)
    {
        $code = $request->input('code');
      //处理40163问题 if($code) { $accessToken = $this->wechat->oauth->getAccessToken($code); $user = $this->wechat->oauth->user($accessToken); dd($user); } return redirect('pay/index'); }

  

posted @ 2019-07-18 16:54  无限REIZ  阅读(802)  评论(0编辑  收藏  举报