【小程序】学习笔记五

----------------------------------------------------------------------

笔记整理自微信小程序官方文档,目的加深印象,以及日后快速查询 

https://developers.weixin.qq.com/miniprogram/dev/framework/

----------------------------------------------------------------------

 

https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share.html

消息转发

通常开发者希望转发出去的小程序被二次打开的时候能够获取到一些信息,例如群的标识。现在通过调用 wx.showShareMenu 并且设置 withShareTicket 为 true ,当用户将小程序转发到任一群聊之后,此转发卡片在群聊中被其他用户打开时,可以在 App.onLaunch 或 App.onShow 获取到一个 shareTicket。通过调用 wx.getShareInfo 接口传入此 shareTicket 可以获取到转发信息。

 

https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/subscribe-message.html

订阅消息

小程序模板消息接口于2020年1月10日下线,使用订阅消息

 

https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/uniform-message.html

统一服务消息

  

https://developers.weixin.qq.com/miniprogram/dev/framework/security.html

安全指引

1、接口鉴权:接口签名、对用户等业务关联信息校验

2、部分敏感信息如用户的银行卡号、手机号等需要用于展示的,需要进行脱敏处理。

3、注入漏洞:SQL注入、命令注入

 

https://developers.weixin.qq.com/miniprogram/dev/framework/performance/tips.html

优化建议

1、setData:避免 频繁的去 setData、每次 setData 都传递大量新数据、后台态页面进行 setData

2、控制代码包内图片资源

3、及时清理没有使用到的代码和资源

 

https://developers.weixin.qq.com/miniprogram/dev/framework/performance/tools.html

分析工具

1、性能trace工具

2、性能面板

 

https://developers.weixin.qq.com/miniprogram/dev/framework/audits/audits.html

体验评分

 

https://developers.weixin.qq.com/miniprogram/dev/framework/realtimelog/

实时日志(线上调试)

 

https://developers.weixin.qq.com/miniprogram/dev/framework/search/seo.html

小程序搜索(SEO

 

 

 

 

得意时做事,失意时读书
原文地址:https://www.cnblogs.com/lanse1993/p/12654603.html