如题,由于是国外主体的小程序,所以没办法开通腾讯的地理位置服务,于是我已经删除了业务逻辑层面所有有关位置的代码(wx.getLocation等),但是最后通过打包后的文件,也就是mp-weixin文件夹下的代码会发现还存在getLocation的相关代码,导致审核不通过,究其原因是由于@dcloudio/uni-stat包中含有以下代码,注释后打包就可以通过审核,但是这种方式更改了原始包,不利于维护(一般包里的东西都不会去动他的,要么删包,要么加包,不怎么会去修改它)。所以我想请问各位大佬如何能更好的处理这个问题呢??
/**
-
获取位置信息
*/
getLocation() {
if (stat_config.getLocation) {
uni.getLocation({
type: 'wgs84',
geocode: true,
success: (result) => {
if (result.address) {
this.statData.cn = result.address.country;
this.statData.pn = result.address.province;
this.statData.ct = result.address.city;
}this.statData.lat = result.latitude; this.statData.lng = result.longitude; this.request(this.statData); },
});
} else {
this.statData.lat = 0;
this.statData.lng = 0;
this.request(this.statData);
}
}