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

扩展门店小程序错误 #762

Closed
ljyljy0211 opened this issue Jun 26, 2017 · 3 comments
Closed

扩展门店小程序错误 #762

ljyljy0211 opened this issue Jun 26, 2017 · 3 comments

Comments

@ljyljy0211
Copy link

我用的环境

PHP 版本:7.1.5
overtrue/wechat 版本:最新版本

问题及现象

描述你的问题现象,报错贴截图粘贴或者贴具体信息,提供必要的代码段

这个$application即vendor/overtrue/wechat/src/Foundation/Application.php
$application->register(new \WechatBundle\Custom\ServicesProviders\XcxServiceProvider);
$application->addProvider(\WechatBundle\Custom\ServicesProviders\XcxServiceProvider::class);

报错

(1/1) InvalidArgumentException
Identifier "xiaochengxu" is not defined.
in Container.php (line 96)
at Container->offsetGet('xiaochengxu')
in Application.php (line 194)
at Application->__get('xiaochengxu')
in web.php (line 30)
at Closure->{closure}()
at call_user_func_array(object(Closure), array())
in BoundMethod.php (line 29)
at BoundMethod::Illuminate\Container{closure}()
in BoundMethod.php (line 75)
at BoundMethod::callBoundMethod(object(AppKernel), object(Closure), object(Closure))
in BoundMethod.php (line 31)
at BoundMethod::call(object(AppKernel), object(Closure), array(), null)
in Container.php (line 539)
at Container->call(object(Closure), array())
in RoutesRequests.php (line 654)

@overtrue
Copy link
Collaborator

你的 provider 怎么写的啊

@ljyljy0211
Copy link
Author

ljyljy0211 commented Jul 10, 2017

找到问题了,第三方授权开发授权的方式,需要注册一个新的扩展,这个扩展的注册要写在EasyWeChat\OpenPlatform\createAuthorizerApplication之后,即以下代码顺序,
`
$authorizerApplication = $this->getApplication()->open_platform->createAuthorizerApplication($authorizerAppId, $authorizerRefreshToken);

$authorizerApplication = $authorizerApplication->register(new \WechatBundle\OvertrueWechat\Foundation\ServiceProviders\MenDianServiceProvider);
`

@overtrue
Copy link
Collaborator

哈哈哈哈

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

2 participants