微信中嵌套页面中得到openId

来源:互联网 发布:怎样开淘宝网店教程 编辑:程序博客网 时间:2024/04/29 09:31

微信中嵌套页面中得到openId

 

在微信公众平台后台:


在业务域名和 网页授权域名 里进行域名的配置。

 

 

String menu = "{\"button\":[" +

       "{\"type\":\"view\",\"name\":\"MENU01\",\"url\":\"https://open.weixin.qq.com/connect/oauth2/authorize?appid="+APPID+"&redirect_uri=http://www.域名.com/weixin/index.jsp&response_type=code&scope=snsapi_base&state=1#wechat_redirect\"}" +

           ",{\"type\":\"click\",\"name\":\"天气查询\",\"key\":\"西安\"}" +

           ",{\"name\":\"日常工作\",\"sub_button\":[" +

           "{\"type\":\"view\",\"name\":\"待办工单\",\"url\":\"http://www.域名.com/weixin/index.jsp\"}" +

           ",{\"type\":\"click\",\"name\":\"已办工单\",\"key\":\"02_FINISH\"}" +

           ",{\"type\":\"click\",\"name\":\"我的工单\",\"key\":\"03_MYJOB\"}" +

           ",{\"type\":\"click\",\"name\":\"公告消息箱\",\"key\":\"04_MESSAGEBOX\"}" +

           ",{\"type\":\"click\",\"name\":\"签到2\",\"key\":\"05_SIGN\"}]}]}";

    System.out.println(deleteMenu());

  System.out.println(createMenu(menu));

 

 

 

在才菜单中配置链接地址:

https://open.weixin.qq.com/connect/oauth2/authorize?appid="+APPID+"&redirect_uri=http://www.域名.com/weixin/index.jsp&response_type=code&scope=snsapi_base&state=1#wechat_redirect

 

 

 

0 0