mirror of
https://gitee.com/beecue/fastbee.git
synced 2025-12-19 09:25:54 +08:00
前端配置文件的简化和统一
This commit is contained in:
@@ -167,7 +167,7 @@ import deviceStatistic from './device-statistic'
|
||||
import deviceTimer from './device-timer'
|
||||
import {
|
||||
loadBMap
|
||||
} from '../map.js'
|
||||
} from '@/utils/map.js'
|
||||
import {
|
||||
getDevice,
|
||||
addDevice,
|
||||
|
||||
@@ -48,10 +48,9 @@ export default {
|
||||
connectTimeout: 10000
|
||||
}
|
||||
// 配置Mqtt地址
|
||||
let url = "wss://iot.wumei.live/mqtt"
|
||||
// let url = "ws://" + window.location.hostname + ":8083/mqtt";
|
||||
console.log("mqtt地址:", url);
|
||||
this.client = mqtt.connect(url, options);
|
||||
console.log("mqtt地址:", process.env.VUE_APP_EMQX_SERVER_URL);
|
||||
this.client = mqtt.connect(process.env.VUE_APP_EMQX_SERVER_URL, options);
|
||||
this.client.on("connect", (e) => {
|
||||
console.log("客户端:" + randomClientId + ",成功连接服务器:", e);
|
||||
// 订阅主题
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
export function loadBMap() {
|
||||
let baiduAK="nAtaBg9FYzav6c8P9rF9qzsWZfT8O0PD";
|
||||
return new Promise(function(resolve, reject) {
|
||||
if (typeof BMap !== 'undefined') {
|
||||
resolve(BMap)
|
||||
return true
|
||||
}
|
||||
window.onBMapCallback = function() {
|
||||
resolve(BMap)
|
||||
}
|
||||
let script = document.createElement('script')
|
||||
script.type = 'text/javascript'
|
||||
script.src =
|
||||
'http://api.map.baidu.com/api?v=2.0&ak='+ baiduAK +'&__ec_v__=20190126&callback=onBMapCallback'
|
||||
script.onerror = reject
|
||||
document.head.appendChild(script)
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user