返回列表 发新帖

人人商城百度地图授权报错详细解决方案

3.1k 0
DeGe 发表于 2020-11-16 22:44:25|中国 | 查看全部 阅读模式
问题描述微擎人人商城报错:百度未授权使用地图API,可能是因为您提供的密钥不是有效的百度LBS开放平台密钥& J/ f$ B9 ]$ N8 Y  {5 @' [: h& n
解决方法一:出现这个问题的原因是源代码里面的百度地图AK失效了,这个时候可以去百度地图直接重新申请一个AK,然后将原来项目里面的AK替换掉
5 p2 q5 I1 s/ q8 d比如下面这个路径下的文件中使用了AK:ZQiFErjQB7inrGpx27M1GR5w3TxZ64k73 q; r- Q$ J8 G! R+ e/ e
项目名\data\tpl\app\ewei_shopv2\plugin\diypage\default\mobile\diypage.tpl.php; O2 j% Z4 `8 i

# E$ B7 @5 \. p  X1 p. V
% n, u# M3 Y; T<script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=ZQiFErjQB7inrGpx27M1GR5w3TxZ64k7&s=1"></script>. q4 `1 |5 c6 R4 i2 ?% w

8 r0 o& R$ b  e/ e8 Y; @
+ R/ u" z2 F8 g1 F$ J1 e, t) t
6 B8 k' t( k& E$ W5 H由于人人商城代码是硬编码的,每个用到百度地图的程序都写了一个AK的配置而不是去同一个配置文件读,解决这个问题就需要批量替换
6 I$ N' A/ H; `# n1.windows服务器下可以使用notepad++,将代码下载下来,批量替换再上传- Z, H! ?3 t* z: a% v
2.linux服务器下,写个批量替换的脚本
6 m2 l/ C, A$ h9 v解决方法一:
( y6 @5 H/ l* [$ m; B7 Z如批量查找不会或有问题的可修改一下路径文件逐个修改
: M; t+ Z; m/ K
7 p* l# P  t0 D<script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=ZQiFErjQB7inrGpx27M1GR5w3TxZ64k7&s=1"></script>
7 G- d- [- p: z' h  y) i' O修改百度地图AK码即可
1 P, G% u! G! @; _! @+ P$ b0 o# G, o
% @5 r* b! t) ]ewei_shopv2\core\model\util.php
' I5 [, |! }8 M* w. d8 ]% }) l6 O$ ^
ewei_shopv2\plugin\article\template\mobile\default\index.html
2 j! u) P8 R7 h! |; S2 M* r" \/ Q8 d5 [6 I& u% f* u% S3 w
ewei_shopv2\plugin\creditshop\template\mobile\default\create.html- `1 Z  h/ d2 ]
- o4 Q1 u$ g# q$ T
ewei_shopv2\plugin\creditshop\template\mobile\default\log_detail.html
" j% V7 ]) N- D! i0 I% t) T1 c9 M1 @9 P5 F: h' J+ C! \) C
ewei_shopv2\plugin\cycelbuy\template\mobile\default\goods\detail.html
: t# m0 \) i' S# W, ]$ Q7 j- h% e" v7 r9 t. I$ d! T
ewei_shopv2\plugin\cycelbuy\template\mobile\default\order\create.html: Q* v& g% o0 f/ t0 U0 t3 ^& x
* g' k/ ]1 r+ \4 f# C* c% o
ewei_shopv2\plugin\diypage\template\mobile\default\index.html) q$ v9 F* _$ u
$ m+ V2 _* |& |7 `6 ^
ewei_shopv2\plugin\diypage\template\mobile\default\template\tpl_detail_store.html
) X  ]2 O' r% _. z2 W# p
8 g# ]4 C; ?$ y& i% ?* U: newei_shopv2\plugin\groups\template\mobile\default\orders\confirm.html8 P2 t( N+ f8 W- }9 B6 I
- U+ h2 i# [+ L: C0 y3 B
ewei_shopv2\plugin\groups\template\mobile\default\orders\detail.html
  i  o  g1 b3 \8 w% A& N4 m
2 X) J  m/ [0 ]5 }8 a: V$ _  G, ^% jewei_shopv2\plugin\merch\template\mobile\default\list\merchuser.html! y5 X* t; o: p/ \+ Z0 T

% e; ]# M( p2 c, K$ o/ rewei_shopv2\static\config0.8.js
6 y/ L0 F9 x7 Z
' E& X7 ?0 w8 ]4 mewei_shopv2\static\config1.0.js
# P* L. K5 @- E: d$ C) d# ~7 g. F  I
ewei_shopv2\static\js\app\biz\store\selector.js
1 ~$ `7 }4 W7 q7 {
+ C' t- y" C6 d2 i& z! R* Oewei_shopv2\static\js\config0.8.js
' y3 d* N% m) o. N' S3 p1 g- _- J2 i) e) C: o& K
ewei_shopv2\static\js\config1.0.js
( i9 Z: h7 p9 B1 b( q8 E0 J
! N9 W+ s$ S2 f: g# p$ ]3 y* e+ _ewei_shopv2\static\template\mobile\default\order\detail.html/ c7 S& ]6 j! e
, G& j5 G1 u# S# M4 }2 D
ewei_shopv2\template\mobile\default\detail.html
" ~4 d! _- K( s% i* E8 r% _3 }$ e; O6 f  I
ewei_shopv2\template\mobile\default\goods\detail.html
' Q" @7 E( b( t8 p5 o, T9 \# o' b/ g: d+ f8 W$ }! m5 g
ewei_shopv2\template\mobile\default\order\create.html; f$ v+ Q1 U! Z) ]8 T/ \  u" c

, b# ^* z4 T& b* _9 Kewei_shopv2\template\mobile\default\order\pay\success.html7 V0 J8 z3 {# z- {' @& s# g% M1 p
  g- I8 i* y) y" [/ m% T  c
ewei_shopv2\template\mobile\default\store\selector.html. |& ^" ^: h7 q

# K9 Y6 G* K+ o; ]$ V$ uewei_shopv2\template\mobile\diypage\goods\detail.html
+ r& W: `1 v8 g5 K
/ f4 \9 ], {; W% g! J+ s* {" n
3 J1 R! z- O0 ~2 A3 [

回复

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

本版积分规则

得知互动是一个融创意、设计、开发、营销、生活、互联网于一体的专业交流分享平台。
Copyright © 2026 得知互动-专注Ai与站长技术交流社区-Ai交流平台 版权所有 All Rights Reserved. Powered by Discuz! X5.0 鄂ICP备15006301号-5|鄂公网安备 42018502006730号
关灯 在本版发帖 扫一扫添加QQ客服 返回顶部
快速回复 返回顶部 返回列表