一、上传会用到的一些东西:
1.wx.chooseImage;
2.wx.uploadFile;
3.获取上传需要的签名(signature)和加密策略(policy)和上传url(host)的接口;
二、步骤拆解:
1.通过接口获取签名等信息;
2.选择图片得到filePath;
3.上传图片得到oss图片路径并渲染;
三、代码实现:
ossPolicy:{
OSSAccessKeyId: "LTAIEGwazoZUp6GV",
accessid: "LTAIEGwazoZUp6GV",
dir: "",
expire: 1559634215,
host: "http://dhb-business-card.oss-cn-aabbccdd.aliyuncs.com",
policy: "eyJleHBpcmF0aW9uIjoiMjAxOS0wNi0wNFQxNTo0MzozNVoiLCJjb25kaXRpb25zIjpbWyJjb250ZW50LWxlbmd0aC1yYW5nZSIsMCwyM