This commit is contained in:
xman 2025-04-25 16:37:07 +08:00
parent 78623550ba
commit b27654d765
3 changed files with 12 additions and 2 deletions

View File

@ -57,9 +57,14 @@ class Worker extends Backend
*/ */
public function index() public function index()
{ {
//设置过滤方法 //设置过滤方法
$this->request->filter(['strip_tags', 'trim']); $this->request->filter(['strip_tags', 'trim']);
if (false === $this->request->isAjax()) { if (false === $this->request->isAjax()) {
$appkey = config('map.baidu_app_key');
$this->assign('mapkey',$appkey);
return $this->view->fetch(); return $this->view->fetch();
} }
//如果发送的来源是 Selectpage则转发到 Selectpage //如果发送的来源是 Selectpage则转发到 Selectpage

View File

@ -255,7 +255,7 @@
<script> <script>
window.initMap = function () { window.initMap = function () {
const map = new BMapGL.Map("bar-chart"); const map = new BMapGL.Map("bar-chart");
map.centerAndZoom(new BMapGL.Point(104.0665, 30.5728), 7); map.centerAndZoom(new BMapGL.Point(104.0665, 30.5728), 6);
map.enableScrollWheelZoom(true); map.enableScrollWheelZoom(true);
map.addEventListener('tilesloaded', function () { map.addEventListener('tilesloaded', function () {
@ -332,5 +332,5 @@
}; };
</script> </script>
<script src="https://api.map.baidu.com/api?type=webgl&v=1.0&ak=UQjHtbQQoDQRpAE5QLGFvC8exM6rcu69&callback=initMap"></script> <script src="https://api.map.baidu.com/api?type=webgl&v=1.0&ak={$mapkey}&callback=initMap"></script>

View File

@ -0,0 +1,5 @@
<?php
return [
'baidu_app_key' => 'UQjHtbQQoDQRpAE5QLGFvC8exM6rcu69'
];