得知互动

标题: 人人商城百度地图授权报错详细解决方案 [打印本页]

作者: DeGe    时间: 2020-11-16 22:44
标题: 人人商城百度地图授权报错详细解决方案
问题描述微擎人人商城报错:百度未授权使用地图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








欢迎光临 得知互动 (https://bbs.dezhifl.com/) Powered by Discuz! X3.4