我正在开发一个小程序,用的是云开发功能,现在有一个需求,就是我的小程序上需要生成一个二维码,这个二维码可以在微信之外的其他app扫码,这就需要二维码是一个http/https链接,但是我没发现云开发有生成一个链接的功能,这就让我很头疼了,本来选的云开发是希望不用关心运维和服务端相关工作,现在我还得买服务器,买域名,部署环境,考虑并发、负载等等,就为了这么一个小小的需求,确实有点得不偿失,请问微信小程序官方有这个功能吗,没有这个功能考虑可以后期加入吗,非常感谢🙏
云开发能不能生成一个官方的http/https的链接啊?Can cloud development generate an official http/https link?
云开发能不能生成一个官方的http/https的链接啊?我正在开发一个小程序,用的是云开发功能,现在有一个需求,就是我的小程序上需要生成一个二维码,这个二维码可以在微信之外的其他app扫码,这就需要二维码是一个http/https链接,但是我没发现云开发有生成一个链接的功能,这就让我很头疼了,本来选的云开发是希望不用关心运维和服务端相关工作,现在我还得买服务器,买域名,部署环境,考虑并发、负载等等,就为了这么一个小小的需求,确实有点得不偿失,请问微信小程序官方有这个功能吗,没有这个功能考虑可以后期加入吗,非常感谢🙏
I am developing a small program that uses the cloud development function. Now I have a requirement that my small program needs to generate a QR code. This QR code can be scanned in other apps other than wechat. This requires the QR code to be an HTTP / HTTPS link. However, I didn't find that cloud development has the function of generating a link, which made me headache. The original choice was Yunkai I hope I don't care about the operation and maintenance of the server. Now I have to buy servers, domain names, deployment environment, concurrency, load and so on. Just for such a small demand, it's really a little bit more than the gain. Do you have this function in the official wechat applet? If you don't have this function, can you join it later? Thank you very much 🙏
回答:
这都是自己写的,对接第三方API
云存储可以生成链接
先自己做个服务端页面A,对接调用云开发相关功能。
云开发 HTTP API 文档 | 微信开放文档
https://developers.weixin.qq.com/miniprogram/dev/wxcloudeference-http-api/
把页面A链接生成一个二维码。
直接调用第三方生成二维码。比如
http://qr.liantu.com/api.php?text=http://www.baidu.com
这样生成了百度的二维码
云存储就支持https链接啊,如果权限设置为所有用户可读,这个链接是永不过期一直有效的,完全可以当做图床使用。二维码、小程序码都可以使用云函数直接生成,既可以带上页面路径信息,还可以带上用户相关的参数。