1、創建config.js文件
2、在config文件中通過__wxConfig.envVersion獲取小程序當前版本
envVersion: 'develop', //開發版
envVersion: 'trial', //體驗版
envVersion: 'release', //正式版
也可以根據官方api來獲取版本:https://developers.weixin.qq.com/miniprogram/dev/api/open-api/account-info/wx.getAccountInfoSync.html
3、通過版本匹配接口