Open coleava opened 1 year ago
解决方案:
一、unipp项目 打开uniapp 项目的配置文件manifest.json,选择“源码视图”。
/* 小程序特有相关 */ "mp-weixin": { "appid": "你的开发者id", "setting": { "urlCheck": true, "es6": true, "postcss": true, "minified": true }, "usingComponents": true, "permission": { "scope.userLocation": { "desc": "你的位置信息将用于小程序位置接口的效果展示" } }, "requiredPrivateInfos": [ "getLocation" // 添加此配置 要不无法获取地理位置列表 ]
二、原生小程序
打开项目的配置文件app.json
{ "pages": ["pages/index/index"], "permission": { "scope.userLocation": { "desc": "你的位置信息将用于小程序位置接口的效果展示" // 高速公路行驶持续后台定位 } }, "requiredPrivateInfos": [ "getLocation" // 添加此配置 要不无法获取地理位置列表 ]
解决方案:
一、unipp项目 打开uniapp 项目的配置文件manifest.json,选择“源码视图”。
二、原生小程序
打开项目的配置文件app.json