fix(projects): fix baidu map request protocol

This commit is contained in:
Soybean 2024-05-08 23:19:49 +08:00
parent fbebef3acb
commit 81d51a9630
2 changed files with 13 additions and 0 deletions

View File

@ -7,3 +7,14 @@ declare namespace BMap {
}
declare const TMap: any;
interface Window {
/**
* make baidu map request under https protocol
*
* - 0: http
* - 1: https
* - 2: https
*/
HOST_TYPE: '0' | '1' | '2';
}

View File

@ -5,6 +5,8 @@ import { BAIDU_MAP_SDK_URL } from '@/constants/map-sdk';
defineOptions({ name: 'BaiduMap' });
window.HOST_TYPE = '2';
const { load } = useScriptTag(BAIDU_MAP_SDK_URL);
const domRef = ref<HTMLDivElement>();