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

菜单类型无法处理(二级菜单):view #2638

Closed
5 of 13 tasks
withsalt opened this issue May 11, 2022 · 2 comments
Closed
5 of 13 tasks

菜单类型无法处理(二级菜单):view #2638

withsalt opened this issue May 11, 2022 · 2 comments

Comments

@withsalt
Copy link

withsalt commented May 11, 2022

问题描述

获取公众号菜单时,出现错误“菜单类型无法处理(二级菜单):xxx”

重现问题步骤(如果可以)
  1. 调用CommonApi.GetMenu
  2. 公众号菜单包含二级菜单,二级菜单中包含click或者view类型菜单
发现问题的模块
  • Senparc.Weixin.MP 版本:16.18.2
模块对应的 .net 版本
  • .net 5.x / 6.x
开发环境
  • Visual Studio 2019
  • Visual Studio 2022
  • Visual Studio Code
  • 其他:
缓存环境
  • [] 服务器内存缓存(默认)
  • Redis 版本:
  • Memcached 版本:
  • 其他:
系统环境
  • Windows,版本:
  • Linux,版本:
  • Mac,版本:
  • 其他:
联系方式

Email:sysrun@163.com

(也可将问题地址及联系方式发送到 www.jeffrey.su@gmail.com)

问题原因

CommonApi中GetButtonGroup方法,在对二级菜单进行处理时,重新跳入if,代码第369行。

else if (subSubButton.type.Equals("VIEW_LIMITED", StringComparison.OrdinalIgnoreCase))
                        {
                            //永久素材按钮
                            subButton.sub_button.Add(new SingleViewLimitedButton()
                            {
                                name = subSubButton.name,
                                media_id = subSubButton.media_id,
                                type = subSubButton.type
                            });
                        }
                        if (subSubButton.type.Equals("SCANCODE_WAITMSG", StringComparison.OrdinalIgnoreCase))
                        {
                            //扫码推事件且弹出“消息接收中”提示框
                            subButton.sub_button.Add(new SingleScancodeWaitmsgButton()
                            {
                                name = subSubButton.name,
                                key = subSubButton.key,
                                type = subSubButton.type
                            });
                        }
                        else if (subSubButton.type.Equals("ARTICLE_ID", StringComparison.OrdinalIgnoreCase))
                        {
                            //article_id 按钮
                            subButton.sub_button.Add(new SingleArticleIdButton()
                            {
                                name = subSubButton.name,
                                article_id = subSubButton.article_id,
                                type = subSubButton.type
                            });
                        }
JeffreySu added a commit that referenced this issue May 11, 2022
MP v16.18.2.1 修复二级菜单按钮判断逻辑 #2638 感谢 @withsalt
@JeffreySu
Copy link
Owner

MP v16.18.2.1 #2638 已进入发布管道,感谢! @withsalt

@withsalt
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

2 participants