Taro报错{“errMsg“:“getLocation:fail the api need to be declared in the requiredPrivateInfos field in a

上班了,第一个任务是写小程序,网上关于Taro报错的内容较少,在此记录一下

直接说解决方案

在app.config.js下添加

 permission: {
    'scope.userLocation': {
      desc: '你的位置信息将用于小程序位置接口的效果展示'
    }
  },
  "requiredBackgroundModes": ["audio", "location"],
  "requiredPrivateInfos": ["getLocation"],

你可能感兴趣的:(taro,微信小程序,小程序)