- 为什么在微信浏览器调用uni.getLocation无法获取位置(h5页面)?
uni.getLocation({ type: 'gcj02', geocode: true, isHighAccuracy:true, success: (res) => { if (res.longitude == that.get('location').longitude && res.latitude == that.get('location').latitude) { resolve(that.get('location')) } else { uni.request({ url: "https://restapi.amap.com/v3/geocode/regeo", method: 'get', data: { location: res.longitude + "," + res.latitude, //位置坐标:格式:location=lng<经度>,lat<纬度> key: '开发密钥', // 开发密钥(web服务Key) }, success: (res1) => { if (res1.data.status == 1) { let params = {} params.longitude = res.longitude params.latitude = res.latitude params.building = res1.data.regeocode.addressComponent.businessAreas[0].name params.city = res1.data.regeocode.addressComponent.city.slice(0, res1.data.regeocode.addressComponent.city.length - 1) params.address = res1.data.regeocode.formatted_address resolve(params) } else { that.showErr(12345) reject('获取定位失败') } }, fail: (err) => { reject(err) } }) } }, fail: (err) => { reject(err) }, complete: (res) => { uni.hideLoading() } })
02-22 - 为什么小程序上线后一直是请求本地服务而不是线上的服务?
我配置了根路径,在请求拦截器中做了环境判断,不同的环境根路径不同,但是线上应该是生产环境但是一直都是本地服务,这是为什么?
2024-10-17 - 找不到开通人脸核身的入口?
小程序后台里面没有人脸核身的开通入口
2024-10-11