- 工具不能复制粘贴
工具里ctrl+c/x 用不了, 右键复制/剪切没任何作用 ,ctrl+v还是我在其他地方复制的东西
2018-10-29 - 小程序播放音频
[图片]小程序在播放音频的时候是不是要以wxfile开头 [图片]我用http开头就播放不出来
2018-10-25 - 在Ios上推送模板消息没事,在Android上就报400
[图片] @RequestMapping("/template_type.do") @ResponseBody public static ResponseResult<Void> makeRouteMessage(Template template, String token, String[] array){ System.out.println(Arrays.toString(array)); System.out.println(); Map<String, Map<String, Object>> data = new LinkedHashMap<String, Map<String,Object>>(); Map<String, Object> map1 = new HashMap<String, Object>(); map1.put("value", array[0]); data.put("keyword1", map1); Map<String, Object> map2 = new HashMap<String, Object>(); map2.put("value", array[1]); data.put("keyword2", map2); Map<String, Object> map3 = new HashMap<String, Object>(); map3.put("value", array[2]); data.put("keyword3", map3); template.setData(data); net.sf.json.JSONObject jsonObject = net.sf.json.JSONObject.fromObject(template); System.out.println(template); return sendTemplateMessage(token, jsonObject+""); } public static JSONObject httpRequest(String requestUrl , String requestMethod , String outputStr) { JSONObject jsonObject = null; StringBuffer buffer = new StringBuffer(); try { // 创建SSLContext对象,并使用我们指定的信任管理器初始�? TrustManager[] tm = { new MyX509TrustManager() }; SSLContext sslContext = SSLContext.getInstance("SSL" , "SunJSSE"); sslContext.init(null , tm , new java.security.SecureRandom()); // 从上述SSLContext对象中得到SSLSocketFactory对象 SSLSocketFactory ssf = sslContext.getSocketFactory(); URL url = new URL(requestUrl); HttpsURLConnection httpUrlConn = (HttpsURLConnection) url.openConnection(); httpUrlConn.setSSLSocketFactory(ssf); httpUrlConn.setDoOutput(true); httpUrlConn.setDoInput(true); httpUrlConn.setUseCaches(false); // 设置请求方式(GET/POST�? httpUrlConn.setRequestMethod(requestMethod); if ("GET".equalsIgnoreCase(requestMethod)) httpUrlConn.connect(); // 当有数据需要提交时 if (null != outputStr) { OutputStream outputStream = httpUrlConn.getOutputStream(); // 注意编码格式,防止中文乱�? outputStream.write(outputStr.getBytes("UTF-8")); outputStream.close(); } // 将返回的输入流转换成字符�? InputStream inputStream = httpUrlConn.getInputStream(); InputStreamReader inputStreamReader = new InputStreamReader(inputStream , "utf-8"); BufferedReader bufferedReader = new BufferedReader(inputStreamReader); String str = null; while ((str = bufferedReader.readLine()) != null) { buffer.append(str); } bufferedReader.close(); inputStreamReader.close(); // 释放资源 inputStream.close(); inputStream = null; httpUrlConn.disconnect(); // jsonObject = JSONObject.fromObject(buffer.toString()); return JSONObject.parseObject(buffer.toString()); } catch (ConnectException ce) { System.out.println("Weixin server connection timed out."); } catch (Exception e) { System.out.println("error."); } return jsonObject; } /** * 发送消息 * @param accessToken * @param jsonMsg * @return */ public static ResponseResult<Void> sendTemplateMessage(String accessToken, String jsonMsg){ System.out.println("skfasdhfkdsa: " + jsonMsg); ResponseResult<Void> rr = null; //请求地址 String requestUrl = "https://api.weixin.qq.com/cgi-bin/message/wxopen/template/send?access_token=ACCESS_TOKEN"; requestUrl = requestUrl.replace("ACCESS_TOKEN", accessToken); //发送模板消息 JSONObject jsonObject = httpRequest(requestUrl, "POST", jsonMsg); if(null != jsonObject){ int errorCode = jsonObject.getIntValue("errcode"); String errorMsg = jsonObject.getString("errmsg"); if(0 == errorCode){ rr = new ResponseResult<Void>(errorCode, errorMsg); System.out.println("模板消息发送成功errorCode:{"+errorCode+"},errmsg:{"+errorMsg+"}"); }else{ System.out.println("模板消息发送失败errorCode:{"+errorCode+"},errmsg:{"+errorMsg+"}"); rr = new ResponseResult<Void>(errorCode, errorMsg); } } return rr; }
2018-09-29 - 为什么我添加了合法域名之后,手机测试还是要打开调试
如题
2018-09-18 - 原谅我问个题外话
是不是Tomcat在运行的时候,DNF就很容易被制裁,我都好几次了
2018-09-12 - picker组件的确定按钮怎么设置事件
picker组件,想在确定之后在处理逻辑,是不是有什么属性可以做到
2018-09-08 - 小程序中接受到新的聊天信息
我就想问一下,当别人在小程序的聊天功能中,给我发送了新的消息,能不能通过推送,提示我收到了新的消息
2018-08-28 - 小程序上图片显示问题
小程序在工具里图片没有水印,然而上线之后有的手机有水印,有的没有,链接是一样的,这是为什么?求大神指教
2018-08-14 - 刚获取到的token就过期了
之前正常运行过一次,之前的找不到了,谁帮我看一下哪里有问题,谢谢[图片] [图片] [图片]
2018-08-01 - 怎么测试分享功能
我现在文件都在本地,怎么测试分享功能
2018-07-26