mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-18 08:44:25 +08:00
code refactor
This commit is contained in:
+10
-6
@@ -1,6 +1,10 @@
|
||||
import { asyncLoadAssets } from '@/lib/misc.js';
|
||||
import services from '@/lib/services.js';
|
||||
import settings from '@/lib/settings.js';
|
||||
import {
|
||||
getAmapSecurityVerificationMethod,
|
||||
getAmapApiExternalProxyUrl,
|
||||
getAmapApplicationSecret
|
||||
} from '@/lib/server_settings.js';
|
||||
import logger from '@/lib/logger.js';
|
||||
|
||||
const amapHolder = {
|
||||
@@ -15,12 +19,12 @@ export function loadAmapAssets() {
|
||||
if (!window._AMapSecurityConfig) {
|
||||
const amapSecurityConfig = {};
|
||||
|
||||
if (settings.getAmapSecurityVerificationMethod() === 'internalproxy') {
|
||||
if (getAmapSecurityVerificationMethod() === 'internalproxy') {
|
||||
amapSecurityConfig.serviceHost = services.generateAmapApiInternalProxyUrl();
|
||||
} else if (settings.getAmapSecurityVerificationMethod() === 'externalproxy') {
|
||||
amapSecurityConfig.serviceHost = settings.getAmapApiExternalProxyUrl();
|
||||
} else if (settings.getAmapSecurityVerificationMethod() === 'plaintext') {
|
||||
amapSecurityConfig.securityJsCode = settings.getAmapApplicationSecret();
|
||||
} else if (getAmapSecurityVerificationMethod() === 'externalproxy') {
|
||||
amapSecurityConfig.serviceHost = getAmapApiExternalProxyUrl();
|
||||
} else if (getAmapSecurityVerificationMethod() === 'plaintext') {
|
||||
amapSecurityConfig.securityJsCode = getAmapApplicationSecret();
|
||||
}
|
||||
|
||||
window._AMapSecurityConfig = amapSecurityConfig;
|
||||
|
||||
Reference in New Issue
Block a user