国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

前端 - 在開發(fā)網(wǎng)頁授權(quán)獲取用戶基本信息時(shí)code是null
PHP中文網(wǎng)
PHP中文網(wǎng) 2017-04-17 11:24:52
0
0
880

在開發(fā)網(wǎng)頁授權(quán)獲取用戶基本信息時(shí),第一步的獲取code時(shí)獲取到的是null 網(wǎng)頁授權(quán)獲取用戶基本信息,url地址是:https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx7d24a6105455ffae&redirect_uri=http%3A%2F%2Fmobileotc.999.com.cn%2Fstore%21loginCode.action&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect,請(qǐng)問這是什么原因?

代表如下:

    String url = Constants.DOMAIN+"/store!loginCode.action";
    StringBuffer sb = new StringBuffer("https://open.weixin.qq.com/connect/oauth2/authorize?");
    sb.append("appid=").append(Constants.APPID);
    try {
        sb.append("&redirect_uri=").append(URLEncoder.encode(url, "utf-8"));
        sb.append("&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect");
        log.info("loginWeiXin url:"+sb.toString());
        response.sendRedirect(sb.toString());
    } catch (IOException e) {
        log.info(e.getMessage());

}

獲取代表如下:

    String code= request.getParameter("code");
    log.info("loginCode:"+code);

打印出來的信息是loginCode:null

PHP中文網(wǎng)
PHP中文網(wǎng)

認(rèn)證高級(jí)PHP講師

reply all(0)
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template