百度地图ak更新优化

This commit is contained in:
gongfuxiang 2021-10-25 00:18:46 +08:00
parent f5bb41988c
commit ca13c5c5e1
3 changed files with 3 additions and 3 deletions

View File

@ -229,7 +229,7 @@ class ConfigService
// 替换
$search = ['ak={{common_baidu_map_ak}}', 'ak='.$map_ak_old];
$replace = 'ak='.MyC('common_baidu_map_ak', '{{common_baidu_map_ak}}', true);
$replace = 'ak='.(empty($params['common_baidu_map_ak']) ? '{{common_baidu_map_ak}}' : $params['common_baidu_map_ak']);
$status = file_put_contents($f, str_replace($search, $replace, file_get_contents($f)));
if($status === false)
{

View File

@ -4,7 +4,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<script type="text/javascript" src="../internal.js"></script>
<script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=XSdiGjfg3wOHiKjpYEMG6CYA"></script>
<script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak={{common_baidu_map_ak}}"></script>
<style type="text/css">
.content{width:530px; height: 350px;margin: 10px auto;}
.content table{width: 100%}

View File

@ -14,7 +14,7 @@
overflow: hidden;
}
</style>
<script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=XSdiGjfg3wOHiKjpYEMG6CYA"></script>
<script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak={{common_baidu_map_ak}}"></script>
</head>
<body onload="initMap();">