增加PC端扫码操作#26
Merged
Merged
Conversation
HADB
reviewed
Aug 16, 2017
| var appId = GWC.urlParams['appid']; | ||
| var scope = GWC.urlParams['scope'] || 'snsapi_base'; | ||
| var state = GWC.urlParams['state']; | ||
| var isMp = GWC.urlParams['isMp']; //isMp为true时使用开放平台作授权登录,false为网页扫码登录 |
Owner
There was a problem hiding this comment.
这里会有一个问题,对于其他用户来说,不传isMp时会自动网页扫码登录,向下兼容有问题。并且我们这个主要是作为手机端使用,建议使用一个相反的条件来针对网页扫码登录做单独判断
Author
There was a problem hiding this comment.
这里传与不传的话默认不会去到网页扫码登录,需要同时传进snsapi_login才会去到扫码登录,这里是我的注释解释的有问题。。= =。。isMp只是利用开放平台在公众平台上作授权而已。。
Owner
There was a problem hiding this comment.
了解,刚刚查了下,公众平台没有snsapi_login这个选项,那这里是不是可以直接通过snsapi_login这一个值来判断就可以了,还需要isMp这个参数吗?
Author
There was a problem hiding this comment.
是的,公众平台是没有snsapi_login这个选项的,snsapi_login这个选项是开放平台中的扫码登录的选项,isMp这个选项是必须的,因为针对开放平台的话 扫码与授权 所请求的url不一致。isMp仅仅是针对于使用开放平台在公众号内做授权(个人订阅号或未认证订阅号没有接口权限),如果本身的的公众号有接口权限的话就不需要了。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
增加允许使用开放平台为公众平台授权登录