天翎MyApps技术社区 - 低代码平台 | 流程管理系统 | BPM软件

 找回密码
 注册成为天翎用户
查看: 2652|回复: 0

[消息通知] 微信打开超链推送timeout 消息通知 脚本 sendWeixinRichTextMessage

[复制链接]
wander 发表于 2016-6-24 15:28:28 | 显示全部楼层 |阅读模式
问:打开超链接,微信端显示timeout,而PC端可以正常访问。

答:平台的超链接必须在用户登录的情况下才能正常打开,由于微信端是用微信的接口登录的,
所以超链接也要按微信端的拼接方法。


发送的url的必须是微信完整的url,appid=是微信-权限-管理组的corpid
  1. (function(){
  2.         var userids=getCurrentDocument().getItemValueAsString("接收人");//表单,获取接收人的值
  3.         var touser;
  4.         if(userids!=""&&userids!=null){
  5.                userids = userids.split(';');
  6.                     for (var i=0; i < userids.length; i++ ) {
  7.                     var touserid=userids[i];
  8.                         touser+=getUserById(touserid).getLoginno()+"|";
  9.                 }
  10.           touser=touser.substring(0,touser.length-1);
  11.         }
  12.         
  13.         
  14.         var formid=getCurrentDocument().getFormid();
  15.         var applicationId=getApplication();
  16.         var domainId=getDomainid();
  17.         var docid=getCurrentDocument().getId();
  18.         var request = $WEB.getParamsTable().getHttpRequest();//获取当前request
  19.         
  20.         var url1="http://"+request.getServerName()+":"+request.getServerPort()+getContextPath();
  21.         var url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxb11b73237f69f7ea&redirect_uri="+url1+ "/portal/dynaform/document/view.action?_docid="+docid+"&_formid="+formid+"&application="+applicationId +"&response_type=code&scope=snsapi_base&state="+domainId+"#wechat_redirect";

  22.         var title="发送的标题";
  23.         var description="发送的内容:"+getItemValueAsString("description");


  24.         var picUrl=url1+"/resource/image/photo.png";

  25.         var flag=sendWeixinRichTextMessage(touser,title,description,url,picUrl,domainId,applicationId);
  26.         println("flag==========="+flag);
  27.         return "";
  28. })()
复制代码

本版积分规则

QQ|手机版|天翎MyApps技术社区 ( 粤ICP备11093750号 )

GMT+8, 2026-8-12 03:58

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表