Skip to content

Commit f17b43d

Browse files
committed
feat(secret): 百度地图密钥全局配置
1 parent a5d46ef commit f17b43d

File tree

7 files changed

+11
-9
lines changed

7 files changed

+11
-9
lines changed

src/dgiot/plugins/vue-audio-visual.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ import AudioVisual from 'vue-audio-visual'
22
import BaiduMap from 'vue-baidu-map'
33
Vue.use(AudioVisual)
44
Vue.use(BaiduMap, {
5-
ak: 'WpeAb6pL4tsX2ZVd56GHbO9Ut6c4HZhG',
5+
ak: Vue.prototype.$dgiot.secret.baidu.map,
66
})

src/store/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ const store = new Vuex.Store({
2828
plugins,
2929
})
3030
export default store
31-
info.secret = Base64.encode(JSON.stringify(info.secret))
32-
info.secretMsg =
33-
'dgiot.secret字段属于机密信息,为了安全起见不予直接展示。已使用Base64加密'
31+
// info.secret = Base64.encode(JSON.stringify(info.secret))
32+
// info.secretMsg =
33+
// 'dgiot.secret字段属于机密信息,为了安全起见不予直接展示。已使用Base64加密'
3434
// 解密方法 Base64.decode(dgiot.secret)
3535
// if (!window.isInnerIp) getTags()
3636

src/utils/utilwen.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,5 +547,7 @@ export default {
547547
Vue.prototype.$getTopic = getTopic
548548
Vue.prototype.$subscribe = subscribe
549549
Vue.prototype.$unSubscribe = unSubscribe
550+
// 全局配置环境变量
551+
Vue.prototype.$dgiot = window.dgiot
550552
},
551553
}

src/views/CloudPressure/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
</el-input>
5353
</label>
5454
<baidu-map
55-
ak="WpeAb6pL4tsX2ZVd56GHbO9Ut6c4HZhG"
55+
:ak="$dgiot.secret.baidu.map"
5656
:center="mapLabel.position"
5757
:map-click="false"
5858
:scroll-wheel-zoom="true"

src/views/DeviceCloud/manage/home_index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
</el-input>
3737
</label>
3838
<baidu-map
39-
ak="WpeAb6pL4tsX2ZVd56GHbO9Ut6c4HZhG"
39+
:ak="$dgiot.secret.baidu.map"
4040
:center="{ lng: 116.404, lat: 39.915 }"
4141
:map-click="false"
4242
:scroll-wheel-zoom="true"
@@ -150,7 +150,7 @@
150150
</label>
151151
<baidu-map
152152
v-if="map.innerVisible"
153-
ak="WpeAb6pL4tsX2ZVd56GHbO9Ut6c4HZhG"
153+
:ak="$dgiot.secret.baidu.map"
154154
:center="{ lng: 116.404, lat: 39.915 }"
155155
:map-click="false"
156156
:scroll-wheel-zoom="true"

src/views/DeviceCloud/manage/platform_overview.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@
704704
},
705705
mapType: 'baidu',
706706
isShow: true,
707-
ak: 'WpeAb6pL4tsX2ZVd56GHbO9Ut6c4HZhG',
707+
ak: this.$dgiot.secret.baidu.map,
708708
// ak: 'oW2UEhdth2tRbEE4FUpF9E5YVDCIPYih',
709709
// center:{ lng: 120.187273, lat: 30.334877 },
710710
center: {

src/views/Home/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@
704704
},
705705
mapType: 'baidu',
706706
isShow: true,
707-
ak: 'WpeAb6pL4tsX2ZVd56GHbO9Ut6c4HZhG',
707+
ak: this.$dgiot.secret.baidu.map,
708708
// ak: 'oW2UEhdth2tRbEE4FUpF9E5YVDCIPYih',
709709
// center:{ lng: 120.187273, lat: 30.334877 },
710710
center: {

0 commit comments

Comments
 (0)