uniapp开发小程序接口环境配置

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、通过版本匹配接口

posted @ 2022-03-03 15:07  .南  阅读(1185)  评论(0)    收藏  举报