Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

增加PC端扫码操作 #26

Merged
merged 1 commit into from
Aug 16, 2017
Merged

增加PC端扫码操作 #26

merged 1 commit into from
Aug 16, 2017

Conversation

q250305917
Copy link

增加允许使用开放平台为公众平台授权登录

增加允许使用开放平台作订阅号授权
@@ -55,11 +55,17 @@
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为网页扫码登录
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里会有一个问题,对于其他用户来说,不传isMp时会自动网页扫码登录,向下兼容有问题。并且我们这个主要是作为手机端使用,建议使用一个相反的条件来针对网页扫码登录做单独判断

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里传与不传的话默认不会去到网页扫码登录,需要同时传进snsapi_login才会去到扫码登录,这里是我的注释解释的有问题。。= =。。isMp只是利用开放平台在公众平台上作授权而已。。

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

了解,刚刚查了下,公众平台没有snsapi_login这个选项,那这里是不是可以直接通过snsapi_login这一个值来判断就可以了,还需要isMp这个参数吗?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是的,公众平台是没有snsapi_login这个选项的,snsapi_login这个选项是开放平台中的扫码登录的选项,isMp这个选项是必须的,因为针对开放平台的话 扫码与授权 所请求的url不一致。isMp仅仅是针对于使用开放平台在公众号内做授权(个人订阅号或未认证订阅号没有接口权限),如果本身的的公众号有接口权限的话就不需要了。

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK,LGTM!

@HADB HADB merged commit df75472 into HADB:master Aug 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants