关灯
开启左侧

[实用代码] 人人商城百度地图授权报错详细解决方案

[复制链接]
DeGe 发表于 2020-11-16 22:44:25 | 显示全部楼层 |阅读模式 打印 上一主题 下一主题
 
问题描述微擎人人商城报错:百度未授权使用地图API,可能是因为您提供的密钥不是有效的百度LBS开放平台密钥
解决方法一:出现这个问题的原因是源代码里面的百度地图AK失效了,这个时候可以去百度地图直接重新申请一个AK,然后将原来项目里面的AK替换掉
比如下面这个路径下的文件中使用了AK:ZQiFErjQB7inrGpx27M1GR5w3TxZ64k7
项目名\data\tpl\app\ewei_shopv2\plugin\diypage\default\mobile\diypage.tpl.php


<script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=ZQiFErjQB7inrGpx27M1GR5w3TxZ64k7&s=1"></script>



由于人人商城代码是硬编码的,每个用到百度地图的程序都写了一个AK的配置而不是去同一个配置文件读,解决这个问题就需要批量替换
1.windows服务器下可以使用notepad++,将代码下载下来,批量替换再上传
2.linux服务器下,写个批量替换的脚本
解决方法一:
如批量查找不会或有问题的可修改一下路径文件逐个修改

<script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=ZQiFErjQB7inrGpx27M1GR5w3TxZ64k7&s=1"></script>
修改百度地图AK码即可

ewei_shopv2\core\model\util.php

ewei_shopv2\plugin\article\template\mobile\default\index.html

ewei_shopv2\plugin\creditshop\template\mobile\default\create.html

ewei_shopv2\plugin\creditshop\template\mobile\default\log_detail.html

ewei_shopv2\plugin\cycelbuy\template\mobile\default\goods\detail.html

ewei_shopv2\plugin\cycelbuy\template\mobile\default\order\create.html

ewei_shopv2\plugin\diypage\template\mobile\default\index.html

ewei_shopv2\plugin\diypage\template\mobile\default\template\tpl_detail_store.html

ewei_shopv2\plugin\groups\template\mobile\default\orders\confirm.html

ewei_shopv2\plugin\groups\template\mobile\default\orders\detail.html

ewei_shopv2\plugin\merch\template\mobile\default\list\merchuser.html

ewei_shopv2\static\config0.8.js

ewei_shopv2\static\config1.0.js

ewei_shopv2\static\js\app\biz\store\selector.js

ewei_shopv2\static\js\config0.8.js

ewei_shopv2\static\js\config1.0.js

ewei_shopv2\static\template\mobile\default\order\detail.html

ewei_shopv2\template\mobile\default\detail.html

ewei_shopv2\template\mobile\default\goods\detail.html

ewei_shopv2\template\mobile\default\order\create.html

ewei_shopv2\template\mobile\default\order\pay\success.html

ewei_shopv2\template\mobile\default\store\selector.html

ewei_shopv2\template\mobile\diypage\goods\detail.html



 
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则


5关注

1粉丝

19258帖子

热门图文
热门帖子
排行榜
作者专栏

关注我们:微信订阅号

官方微信

APP下载

全国服务Q Q:

956130084

中国·湖北

Email:956130084@qq.com

Copyright   ©2015-2022  站长技术交流论坛|互联网技术交流平台Powered by©Discuz!技术支持:得知网络  

鄂公网安备 42018502006730号

  ( 鄂ICP备15006301号-5 )