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

WxOpenMpServiceImpl类非public不方便使用 #1122

Closed
yuchonghua opened this issue Jul 18, 2019 · 12 comments
Closed

WxOpenMpServiceImpl类非public不方便使用 #1122

yuchonghua opened this issue Jul 18, 2019 · 12 comments

Comments

@yuchonghua
Copy link

image

image

@binarywang
Copy link
Owner

@007gzs 有空看一下吧

@yuchonghua
Copy link
Author

image
目前使用这个方法解决

@007gzs
Copy link

007gzs commented Jul 18, 2019

判断这个的原因是什么?open的需要做什么特殊处理么?

@yuchonghua
Copy link
Author

是的,举个例子,比如redirectURI这个回调地址,公众号是页面将跳转至 redirect_uri/?code=CODE&state=STATE。然而开放平台是redirect_uri?code=CODE&state=STATE&appid=APPID
,这个时候,你会发现多了一个appid,这个appid在公众号是没有带回来的,就想手动带过去,这样就可以识别出那个应用授权,

再直接点说,就是有那么一些用户,想用自己的域名在公众号中使用,然而,又想绑定直接的域名,并且提供了key,这个时候就没有使用open平台,但是他又是在我这开了一个应用

@yuchonghua
Copy link
Author

因为open的代授权,只能解决比如使用自己的域名

@yuchonghua
Copy link
Author

image
image
image

@007gzs
Copy link

007gzs commented Jul 18, 2019

WxOpenMpServiceImpl没开放出来是怕有些用户不知道该new那个讲WxOpenMpServiceImplWxMpServiceImpl混淆,你这个问题可以自己创建一个类继承WxMpServiceImpl用来做公众号的,判断不是公众号的就走开放平台逻辑

@007gzs
Copy link

007gzs commented Jul 18, 2019

因为这两个的获取方式不同,大部分使用场景下,调用者应该是明白自己是要用三方平台还是直接公众号的,你这种情况继承一下比判断classname好点

@yuchonghua
Copy link
Author

不过我认为一个标准的开发者还是能很清晰自己是在使用WxOpenMpServiceImpl还是WxMpServiceImpl的,毕竟Open是一个明确的标识,而且WxOpenMpServiceImpl 是集成 WxMpServiceImpl的。
不给我还是先去继承WxMpServiceImpl来实现判断先,还是期待有些类能公布出来

@binarywang
Copy link
Owner

可以,这个改为public,不用再讨论了。

binarywang added a commit that referenced this issue Jul 21, 2019

Verified

This commit was signed with the committer’s verified signature.
janicduplessis Janic Duplessis
@binarywang binarywang changed the title /* package */ 导致没法判断一个对象是否为该me.chanjar.weixin.open.api.impl.WxOpenMpServiceImpl类的实现啊 WxOpenMpServiceImpl类非public不方便使用 Jul 21, 2019
@binarywang
Copy link
Owner

3.4.8.B测试版本已添加public参数,欢迎试用

@yuchonghua
Copy link
Author

感谢

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

No branches or pull requests

3 participants