微信企业号 创建菜单 显示不出来

用的 https://github.com/dodgepudding/wechat-php-sdk    qywechat.class.php

 public function actionIndex()
    {
       $weObj = new Wechat([
            'token'=>'eVmGCO33J4jQhisqgHCHMKDB', //填写应用接口的Token
             'encodingaeskey'=>'5V6sDk8AQoc7GqnwfR7TsUCwJD8107rnMDcsjkE65Cu', //填写加密用的EncodingAESKey
             'appid'=>'wxb7dd069b9094e0a2', //填写高级调用功能的app id
             'appsecret'=>'nwgpSx0jMqZFNw06p45X1TVdE3eWDuZ0Al4iQowRMDXQVa8ZGUY1ANWBpLempF4u', //填写高级调用功能的密钥
             'agentid'=>'25', //应用的id
        ]);
        $weObj->valid(); 
        $type = $weObj->getRev()->getRevType();
        
        $menu =     array (
               'button' => array (
                  array (
                   'name' => '扫码',
                   'sub_button' => array (
                       0 => array (
                         'type' => 'scancode_waitmsg',
                         'name' => '扫码带提示',
                         'key' => 'rselfmenu_0_0',
                       ),
                       1 => array (
                         'type' => 'scancode_push',
                         'name' => '扫码推事件',
                         'key' => 'rselfmenu_0_1',
                       ),
                   ),
                 ),
                  array (
                   'name' => '发图',
                   'sub_button' => array (
                       0 => array (
                         'type' => 'pic_sysphoto',
                         'name' => '系统拍照发图',
                         'key' => 'rselfmenu_1_0',
                       ),
                       1 => array (
                         'type' => 'pic_photo_or_album',
                         'name' => '拍照或者相册发图',
                         'key' => 'rselfmenu_1_1',
                       )
                   ),
                 ),
                  array (
                   'type' => 'location_select',
                   'name' => '发送位置',
                   'key' => 'rselfmenu_2_0'
                 ),
               ),
           );
        $weObj->createMenu($menu,25);  //创建菜单
        switch($type) {
            case Wechat::MSGTYPE_TEXT:
                    $weObj->text("hello, I'm wechat")->reply();
                    exit;
                    break;
            case Wechat::MSGTYPE_EVENT:
                    break;
            case Wechat::MSGTYPE_IMAGE:
                    break;
            default:
                    $weObj->text("help info")->reply();
        }
        
    
    }


你可能感兴趣的:(微信企业号 创建菜单 显示不出来)