提交 f9515ec7 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

refactor(map): 修改 h5 高德配置 key 与 app 一致

上级 245ade6d
......@@ -59,18 +59,18 @@ export function uniManifestJsonPlugin(): Plugin {
sdkConfigs.maps.google &&
sdkConfigs.maps.google.key
const AMapKey =
sdkConfigs.maps && sdkConfigs.maps.AMap && sdkConfigs.maps.AMap.key
const aMapKey =
sdkConfigs.maps && sdkConfigs.maps.amap && sdkConfigs.maps.amap.key
const AMapSecurityJsCode =
const aMapSecurityJsCode =
sdkConfigs.maps &&
sdkConfigs.maps.AMap &&
sdkConfigs.maps.AMap.securityJsCode
sdkConfigs.maps.amap &&
sdkConfigs.maps.amap.securityJsCode
const AMapServiceHost =
const aMapServiceHost =
sdkConfigs.maps &&
sdkConfigs.maps.AMap &&
sdkConfigs.maps.AMap.serviceHost
sdkConfigs.maps.amap &&
sdkConfigs.maps.amap.serviceHost
let locale: string | null | undefined = manifest.locale
locale = locale && locale.toUpperCase() !== 'AUTO' ? locale : ''
......@@ -105,9 +105,9 @@ export function uniManifestJsonPlugin(): Plugin {
export const async = ${JSON.stringify(async)}
export const qqMapKey = ${JSON.stringify(qqMapKey)}
export const googleMapKey = ${JSON.stringify(googleMapKey)}
export const AMapKey = ${JSON.stringify(AMapKey)}
export const AMapSecurityJsCode = ${JSON.stringify(AMapSecurityJsCode)}
export const AMapServiceHost = ${JSON.stringify(AMapServiceHost)}
export const aMapKey = ${JSON.stringify(aMapKey)}
export const aMapSecurityJsCode = ${JSON.stringify(aMapSecurityJsCode)}
export const aMapServiceHost = ${JSON.stringify(aMapServiceHost)}
export const sdkConfigs = ${JSON.stringify(sdkConfigs)}
export const locale = '${locale}'
export const fallbackLocale = '${fallbackLocale}'
......
......@@ -53,7 +53,7 @@ function generatePagesJsonCode(
return `
import { defineAsyncComponent, resolveComponent, createVNode, withCtx, openBlock, createBlock } from 'vue'
import { PageComponent, AsyncLoadingComponent, AsyncErrorComponent, useI18n, setupWindow, setupPage } from '@dcloudio/uni-h5'
import { appId, appName, appVersion, appVersionCode, debug, networkTimeout, router, async, sdkConfigs, qqMapKey, googleMapKey, AMapKey, AMapSecurityJsCode, AMapServiceHost, nvue, locale, fallbackLocale } from './${MANIFEST_JSON_JS}'
import { appId, appName, appVersion, appVersionCode, debug, networkTimeout, router, async, sdkConfigs, qqMapKey, googleMapKey, aMapKey, aMapSecurityJsCode, aMapServiceHost, nvue, locale, fallbackLocale } from './${MANIFEST_JSON_JS}'
const locales = import.meta.globEager('./locale/*.json')
${importLayoutComponentsCode}
const extend = Object.assign
......@@ -262,9 +262,9 @@ function generateConfig(
sdkConfigs,
qqMapKey,
googleMapKey,
AMapKey,
AMapSecurityJsCode,
AMapServiceHost,
aMapKey,
aMapSecurityJsCode,
aMapServiceHost,
nvue,
locale,
fallbackLocale,
......
......@@ -31,12 +31,12 @@ export function getMapInfo() {
key: __uniConfig.googleMapKey,
}
}
if (__uniConfig.AMapKey) {
if (__uniConfig.aMapKey) {
return {
type: MapType.AMAP,
key: __uniConfig.AMapKey,
securityJsCode: __uniConfig.AMapSecurityJsCode,
serviceHost: __uniConfig.AMapServiceHost,
key: __uniConfig.aMapKey,
securityJsCode: __uniConfig.aMapSecurityJsCode,
serviceHost: __uniConfig.aMapServiceHost,
}
}
return {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册