ffx0s
V2EX  ›  微信

微信网页开发用户授权的问题

  •  
  •   ffx0s · Jul 25, 2015 · 1996 views
    This topic created in 4016 days ago, the information mentioned may be changed or developed.

    在网页授权的第一步,获取code值的时候,会先打开这个链接https://open.weixin.qq.com/connect/oauth2/authorize?appid=APPID&redirect_uri=REDIRECT_URI&response_type=code&scope=SCOPE&state=STATE#wechat_redirect
    然后会重定向到链接里redirect_uri参数里面的网址。这样子的话页面就会刷新两遍。如何避免这种情况。

    1 replies    2015-07-25 19:32:34 +08:00
    abelyao
        1
    abelyao  
       Jul 25, 2015 via iPhone
    用户授权之后记录到 SESSION 中,下次再打开如果有 SESSION 则不需要再授权。
    把授权看作是一个登录操作,如果不需要就去掉授权环节。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   932 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 21:27 · PVG 05:27 · LAX 14:27 · JFK 17:27
    ♥ Do have faith in what you're doing.