网络环境判断
parent
d8b74f3420
commit
1cf43924c6
|
|
@ -35,7 +35,7 @@
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import SearchComponent from './SearchComponent.vue';
|
import SearchComponent from './SearchComponent.vue';
|
||||||
import { getAppEnvConfig } from '@/utils/env';
|
import { getAppEnvConfig } from '@/utils/env';
|
||||||
const { VITE_GLOB_API_URL } = getAppEnvConfig();
|
const { VITE_GLOB_API_URL,VITE_GLOB_LAN_API_URL } = getAppEnvConfig();
|
||||||
const VITE_GLOB_API_URL_VAR = ref<String>(VITE_GLOB_API_URL);
|
const VITE_GLOB_API_URL_VAR = ref<String>(VITE_GLOB_API_URL);
|
||||||
import { waiData } from '../LargeScreenMap/linyishi';
|
import { waiData } from '../LargeScreenMap/linyishi';
|
||||||
const mapContainerName = ref<String>();
|
const mapContainerName = ref<String>();
|
||||||
|
|
@ -93,6 +93,8 @@
|
||||||
`http://t0.tianditu.gov.cn/DataServer?T=img_w&x={x}&y={y}&l={z}&tk=${TINADITU_TOKEN}`,
|
`http://t0.tianditu.gov.cn/DataServer?T=img_w&x={x}&y={y}&l={z}&tk=${TINADITU_TOKEN}`,
|
||||||
],
|
],
|
||||||
tileSize: 256,
|
tileSize: 256,
|
||||||
|
minzoom: 1,
|
||||||
|
maxzoom: 17,
|
||||||
},
|
},
|
||||||
'raster-tiles-font': {
|
'raster-tiles-font': {
|
||||||
type: 'raster',
|
type: 'raster',
|
||||||
|
|
@ -168,13 +170,13 @@
|
||||||
|
|
||||||
async function loadMapInfo(){
|
async function loadMapInfo(){
|
||||||
try{
|
try{
|
||||||
await getNetworkType().then(res=>{
|
await axios.get(VITE_GLOB_LAN_API_URL+"/api/DroneCloudQuery/IsPublic").then(res=>{
|
||||||
if(res){
|
if(res.data.result){
|
||||||
networkType.value = "WAN";
|
networkType.value = "WAN";
|
||||||
}else{
|
}else{
|
||||||
networkType.value = "LAN";
|
networkType.value = "LAN";
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
}catch(e){
|
}catch(e){
|
||||||
networkType.value = "WAN";
|
networkType.value = "WAN";
|
||||||
}finally{
|
}finally{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue