Skip to content

Commit

Permalink
feat(secret): 百度地图密钥全局配置
Browse files Browse the repository at this point in the history
  • Loading branch information
h7ml committed Jun 6, 2022
1 parent a5d46ef commit f17b43d
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/dgiot/plugins/vue-audio-visual.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import AudioVisual from 'vue-audio-visual'
import BaiduMap from 'vue-baidu-map'
Vue.use(AudioVisual)
Vue.use(BaiduMap, {
ak: 'WpeAb6pL4tsX2ZVd56GHbO9Ut6c4HZhG',
ak: Vue.prototype.$dgiot.secret.baidu.map,
})
6 changes: 3 additions & 3 deletions src/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ const store = new Vuex.Store({
plugins,
})
export default store
info.secret = Base64.encode(JSON.stringify(info.secret))
info.secretMsg =
'dgiot.secret字段属于机密信息,为了安全起见不予直接展示。已使用Base64加密'
// info.secret = Base64.encode(JSON.stringify(info.secret))
// info.secretMsg =
// 'dgiot.secret字段属于机密信息,为了安全起见不予直接展示。已使用Base64加密'
// 解密方法 Base64.decode(dgiot.secret)
// if (!window.isInnerIp) getTags()

Expand Down
2 changes: 2 additions & 0 deletions src/utils/utilwen.js
Original file line number Diff line number Diff line change
Expand Up @@ -547,5 +547,7 @@ export default {
Vue.prototype.$getTopic = getTopic
Vue.prototype.$subscribe = subscribe
Vue.prototype.$unSubscribe = unSubscribe
// 全局配置环境变量
Vue.prototype.$dgiot = window.dgiot
},
}
2 changes: 1 addition & 1 deletion src/views/CloudPressure/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
</el-input>
</label>
<baidu-map
ak="WpeAb6pL4tsX2ZVd56GHbO9Ut6c4HZhG"
:ak="$dgiot.secret.baidu.map"
:center="mapLabel.position"
:map-click="false"
:scroll-wheel-zoom="true"
Expand Down
4 changes: 2 additions & 2 deletions src/views/DeviceCloud/manage/home_index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
</el-input>
</label>
<baidu-map
ak="WpeAb6pL4tsX2ZVd56GHbO9Ut6c4HZhG"
:ak="$dgiot.secret.baidu.map"
:center="{ lng: 116.404, lat: 39.915 }"
:map-click="false"
:scroll-wheel-zoom="true"
Expand Down Expand Up @@ -150,7 +150,7 @@
</label>
<baidu-map
v-if="map.innerVisible"
ak="WpeAb6pL4tsX2ZVd56GHbO9Ut6c4HZhG"
:ak="$dgiot.secret.baidu.map"
:center="{ lng: 116.404, lat: 39.915 }"
:map-click="false"
:scroll-wheel-zoom="true"
Expand Down
2 changes: 1 addition & 1 deletion src/views/DeviceCloud/manage/platform_overview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@
},
mapType: 'baidu',
isShow: true,
ak: 'WpeAb6pL4tsX2ZVd56GHbO9Ut6c4HZhG',
ak: this.$dgiot.secret.baidu.map,
// ak: 'oW2UEhdth2tRbEE4FUpF9E5YVDCIPYih',
// center:{ lng: 120.187273, lat: 30.334877 },
center: {
Expand Down
2 changes: 1 addition & 1 deletion src/views/Home/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@
},
mapType: 'baidu',
isShow: true,
ak: 'WpeAb6pL4tsX2ZVd56GHbO9Ut6c4HZhG',
ak: this.$dgiot.secret.baidu.map,
// ak: 'oW2UEhdth2tRbEE4FUpF9E5YVDCIPYih',
// center:{ lng: 120.187273, lat: 30.334877 },
center: {
Expand Down

0 comments on commit f17b43d

Please sign in to comment.