由于新版本小程序开发做了更动
需要在app.json档案中添加PermissionObject 结构
说明小程序获取权限时展示的接口用途

如:

{
  "pages": ["pages/index/index"],
  "permission": {
    "scope.userLocation": {
      "desc": "你的位置信息将用于小程序位置接口的效果展示"
    }
  }
}

微信小程序如何获得用户位置权限

相关文章: