UPDATE: I found use
snsapi_base can get user’s
union id, but you can’t get it directly like before.
Few weeks ago, I was developing wechat web app, I found I can get user’s
union id directly via
get access token interface, but yesterday, I found this interface didn’t provide
union id unless you use
snsapi_userinfo as the
scope value. So I changed
snsapi_userinfo, you will get a warning when you’re authorizing on web app no matter whether you subscribed the account or not.
Now you can use
snsapi_base and call
get user info interface to get
union id, just fill
access token of user, you will get user’s basic info, and
union id, this interface is very weird, even you provide an invalid
open id as input you can get right result, maybe wechat only check
access token argument.
I don’t know when these interfaces will be changed, and there is no any notification about changes.
web page authorization
state param only accepts a-zA-Z0-9 characters, I stored JSON strings before, but it doesn’t support now.
snsapi_base can acquire user’s union id if the mp account had bound at
Wechat Open Platform, but now, only
snsapi_userinfo can do this.