|
|
问:打开超链接,微信端显示timeout,而PC端可以正常访问。
答:平台的超链接必须在用户登录的情况下才能正常打开,由于微信端是用微信的接口登录的,
所以超链接也要按微信端的拼接方法。
发送的url的必须是微信完整的url,appid=是微信-权限-管理组的corpid- (function(){
- var userids=getCurrentDocument().getItemValueAsString("接收人");//表单,获取接收人的值
- var touser;
- if(userids!=""&&userids!=null){
- userids = userids.split(';');
- for (var i=0; i < userids.length; i++ ) {
- var touserid=userids[i];
- touser+=getUserById(touserid).getLoginno()+"|";
- }
- touser=touser.substring(0,touser.length-1);
- }
-
-
- var formid=getCurrentDocument().getFormid();
- var applicationId=getApplication();
- var domainId=getDomainid();
- var docid=getCurrentDocument().getId();
- var request = $WEB.getParamsTable().getHttpRequest();//获取当前request
-
- var url1="http://"+request.getServerName()+":"+request.getServerPort()+getContextPath();
- 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";
- var title="发送的标题";
- var description="发送的内容:"+getItemValueAsString("description");
- var picUrl=url1+"/resource/image/photo.png";
- var flag=sendWeixinRichTextMessage(touser,title,description,url,picUrl,domainId,applicationId);
- println("flag==========="+flag);
- return "";
- })()
复制代码
|
|