异步赋值问题
向云数据库添加数据,数据库的内容为空?[图片][图片][图片]
2020-05-30图片链接给一下
小程序上线后,调用服务器上的所有图片打不开,怎么回事?微信小程序上线后,调用服务器上的所有图片打不开,昨天还可以的,在本地和其他小程序上访问是正常的,没有找到原因啊,有遇到的吗?着急啊
2020-05-30[图片] [图片] [图片]
HTTP API进行文件上传的时候,如何把文件转换为二进制,怎么上传?在上传文件拼装时,文件二进制内容怎么获取啊 public static byte[] fileToByte(String filepath) throws IOException{ byte[] bytes = null; FileInputStream fis = null; try{ File file = new File(filepath); fis = new FileInputStream(file); bytes = new byte[(int) file.length()]; fis.read(bytes); }catch(IOException e){ e.printStackTrace(); throw e; }finally{ fis.close(); } return bytes; } 这样对吗?然后我在上传的时候传不进去。 byte[] er=fileToByte("D:\\provinceCode.json"); for(int i=0;i<er.length;i++) { System.out.println(er[i]); } Date date=new Date(); SimpleDateFormat format= new SimpleDateFormat("yyyy-MM-dd"); String dateString = format.format(date); String strURL =file.get("url"); Map<String, Object> paramMap = new HashMap<String, Object>(); paramMap.put("key", "provinceCode.json"); paramMap.put("Signature", file.get("authorization")); paramMap.put("x-cos-security-token", file.get("token")); paramMap.put("x-cos-meta-fileid", file.get("cos_file_id")); paramMap.put("file", er); OutputStreamWriter out = null; try { URL url = new URL(strURL);// 创建连接 HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setDoOutput(true); connection.setDoInput(true); connection.setUseCaches(false); connection.setInstanceFollowRedirects(true); connection.setRequestMethod("POST"); // 设置请求方式 connection.setRequestProperty("Accept", "application/json"); // 设置接收数据的格式 connection.setRequestProperty("Content-Type", "application/json"); //设置发送数据的格式 connection.connect(); out = new OutputStreamWriter(connection.getOutputStream(), "UTF-8"); // utf-8编码 String json = JSON.toJSONString(paramMap); out.append(json); out.flush(); out.close(); } catch (IOException e) { e.printStackTrace(); } finally { try { out.close(); } catch (IOException e) { e.printStackTrace(); } } 哪里出问题了啊!!!跪求大佬们帮忙!!!
2020-05-29你_id 是 “46(数据缩减了,是_id)"?
云数据库remove方法报错?代码是: db.collection('fruit').doc('46(数据缩减了,是_id)').remove({ success: function(res) { console.log(res.data) } }) 报错为: Error: errCode: -1 | errMsg: document.remove:fail Error: cannot remove document with _id 46, please make sure that the document exists and you have the corresponding Write permission; at document.remove api; 这个云数据库权限已设置为所有人可改动,求解,另外拜托大家教教用where指定条件删除
2020-05-29JSON.stringify(detail)
wx.navigateTo传参后显示[object object]?[图片]
2020-05-29你写错了 [图片]
微信发票插卡postman调用invalid params, fee is empty hint?[图片] 发票链接:https://developers.weixin.qq.com/doc/offiaccount/WeChat_Invoice/E_Invoice/Invoicing_Platform_API_List.html#5 { "order_id":"202005290000003", "card_id":"pMX-a1GJrPdDrYNngMtPpvb-Qz5U", "appid":"wxf3478a2ab0f6ae09", "card_ext":{ "nonce_str":"234bgZXl", "user_card":{ "fee":5, "title":"123323", "billing_time":1244534234, "billing_no":"312312", "billing_code":"213124", "fee_without_tax":1, "tax":1, "s_pdf_media_id":"7281293713727554138", "check_code":2312 } } }
2020-05-29jifen是个字符串吗 [图片]
小程序里为什么出现重复内容?[图片][图片][图片]
2020-05-29你的解密代码,试了很多次都不报错 [图片] [图片]
用户授权登录解密失败?第一次同意授权登录 拿到前端的code去请求微信的https://api.weixin.qq.com/sns/jscode2session获取微信的openid和session_key 解密成功了获取到了用户信息 但是在用新的code去请求的时候 解密失败;请问有谁遇到了吗
2020-05-29这个是报错了,你是用什么方式上传的
云开发上传文件后,文件大小变成107byte,为什么呢?[图片]
2020-05-29亮一下代码
云函数开启本地调试失败?本地有npm环境,cloudfunctions目录下面也做了npm install wx-server-sdk@latest,求助[图片] // 云函数入口文件 const cloud = require('wx-server-sdk') cloud.init() // 云函数入口函数 exports.main = async (event, context) => { return{ sum = event.a + event.b } }
2020-05-29