mingyoung / dingtalk

[已停止维护]

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

事件订阅 RuntimeException: Invalid CorpId

pleaseyang opened this issue · comments

微信截图_20201221190449

解密的时候会出现特殊字符。 不知道是不是这个原因导致解密失败。目前事件订阅一直无法通过

[2020-12-21 19:00:47] local.DEBUG: npQpVg6AN75aeCmV �{"EventType":"check_url"}ding2alggykjubbmwmji������������������������������� [2020-12-21 19:00:47] local.DEBUG: Exception [2020-12-21 19:00:47] local.DEBUG: RuntimeException: Invalid CorpId. in D:\wamp64\www\sagawa\vendor\mingyoung\dingtalk\src\Kernel\Encryption\Encryptor.php:107 Stack trace: #0 D:\wamp64\www\sagawa\vendor\mingyoung\dingtalk\src\Kernel\Server.php(100): EasyDingTalk\Kernel\Encryption\Encryptor->decrypt('\x00\x00\x00\x19{"EventType...', 'f6b851ed490f95e...', 'M4Gf8bs3', '1608548446448') #1 D:\wamp64\www\sagawa\vendor\mingyoung\dingtalk\src\Kernel\Server.php(47): EasyDingTalk\Kernel\Server->getPayload() #2 D:\wamp64\www\sagawa\app\Http\Controllers\Admin\DingTalkController.php(194): EasyDingTalk\Kernel\Server->serve() #3 [internal function]: App\Http\Controllers\Admin\DingTalkController->eventreceive(Object(Illuminate\Http\Request)) #4 D:\wamp64\www\sagawa\vendor\laravel\framework\src\Illuminate\Routing\Controller.php(54): call_user_func_array(Array, Array)

应该是bug 我这样修改后就可以了

/*

  • This file is part of the mingyoung/dingtalk.
  • (c) 张铭阳 mingyoungcheung@gmail.com
  • This source file is subject to the MIT license that is bundled
  • with this source code in the file LICENSE.
    */

namespace EasyDingTalk\Kernel\Providers;

use EasyDingTalk\Kernel\Encryption\Encryptor;
use Pimple\Container;
use Pimple\ServiceProviderInterface;

class EncryptionServiceProvider implements ServiceProviderInterface
{
/**
* Registers services on the given container.
* This method should only be used to configure services and parameters.
* It should not get services.
*
* @param \Pimple\Container $pimple A container instance
*/
public function register(Container $pimple)
{
$pimple['encryptor'] = function ($app) {
return new Encryptor(
$app['config']->get('app_key'),
$app['config']->get('token'),
$app['config']->get('aes_key')
);
};
}
}

image

确实会存在这个问题

确实,大佬什么时候改一下 @mingyoung

commented

closed了?好像还是有这个问题