修复公众号菜单保存失败bug

This commit is contained in:
TinyAnts 2022-09-14 17:14:21 +08:00
parent 681e4eaa9c
commit b7f2a4dcba
2 changed files with 17 additions and 19 deletions

View File

@ -85,23 +85,21 @@ public class ChannelOaMenuServiceImpl implements IChannelOaMenuService {
}
for (Map<String, String> subItem : subButtons) {
WxMenuButton subMenuButton = new WxMenuButton();
if (Integer.parseInt(subItem.get("menuType")) == 1) {
Assert.notNull(subItem.get("visitType"), "子级菜单visitType参数缺失!");
if (subItem.get("visitType").equals("miniprogram")) {
Assert.notNull(subItem.get("appId"), "子级菜单appId参数缺失!");
Assert.notNull(subItem.get("url"), "子级菜单url数缺失!");
Assert.notNull(subItem.get("pagePath"), "子级菜单pagePath数缺失!");
wxMenuButton.setType(subItem.get("visitType"));
wxMenuButton.setAppId(subItem.get("appId"));
wxMenuButton.setUrl(subItem.get("url"));
wxMenuButton.setPagePath(subItem.get("pagePath"));
} else {
Assert.notNull(subItem.get("url"), "子级菜单url数缺失");
wxMenuButton.setType(subItem.get("visitType"));
wxMenuButton.setUrl(subItem.get("url"));
}
menuButtons.add(subMenuButton);
Assert.notNull(subItem.get("visitType"), "子级菜单visitType参数缺失!");
if (subItem.get("visitType").equals("miniprogram")) {
Assert.notNull(subItem.get("appId"), "子级菜单appId参数缺失!");
Assert.notNull(subItem.get("url"), "子级菜单url数缺失!");
Assert.notNull(subItem.get("pagePath"), "子级菜单pagePath数缺失!");
wxMenuButton.setType(subItem.get("visitType"));
wxMenuButton.setAppId(subItem.get("appId"));
wxMenuButton.setUrl(subItem.get("url"));
wxMenuButton.setPagePath(subItem.get("pagePath"));
} else {
Assert.notNull(subItem.get("url"), "子级菜单url数缺失");
wxMenuButton.setType(subItem.get("visitType"));
wxMenuButton.setUrl(subItem.get("url"));
}
menuButtons.add(subMenuButton);
}
}
}

View File

@ -71,9 +71,9 @@ public class LoginController {
@GetMapping("/oaLogin")
public Object oaLogin(@RequestParam Map<String, String> params) {
log.error("微信公众号 ===================");
log.error(JSON.toJSONString(params));
// iLoginService.officeLogin(params);
// log.error("微信公众号 ===================");
// log.error(JSON.toJSONString(params));
iLoginService.officeLogin(params);
return AjaxResult.success();
}