From 571f87e61cedd6aac778e8faafbb58ff562fb5df Mon Sep 17 00:00:00 2001 From: quanyawei <401863037@qq.com> Date: Thu, 04 Jul 2024 14:23:41 +0800 Subject: [PATCH] fix: 高德密钥修改 --- src/main.js | 89 ++++++++++++++++++++++++++------------------ 1 files changed, 53 insertions(+), 36 deletions(-) diff --git a/src/main.js b/src/main.js index db2981c..d5c7eea 100644 --- a/src/main.js +++ b/src/main.js @@ -20,31 +20,15 @@ import '@/permission' // permission control // clipboard������������������������������������������������JS������ import clipboard from 'clipboard' -// ���������vue��������� -Vue.prototype.$clipboard = clipboard // ������������ import AMap from 'vue-amap' -Vue.use(AMap) -AMap.initAMapApiLoader({ - key: 'be57d4add7dc10fb7f7924763a2179ae', - plugin: ['AMap.moveAnimation', 'AMap.Autocomplete', 'AMap.PlaceSearch', 'AMap.Scale', - 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType', 'AMap.PolyEditor', 'AMap.CircleEditor', - 'AMap.DistrictSearch'], - // ������������ sdk ��������� 1.4.4 - v: '1.4.4' -}) - -Vue.prototype.$AMap = AMap // crypto������ import { Encrypt } from '@/utils/AES.js' import { getToken } from '@/utils/auth' import request from '@/utils/request' - -Vue.prototype.$request = request.service -Vue.prototype.$axiosRequest = request.reqServe // Vue.prototype.$postRequest=request.reqServe1 /** * If you don't want to use mock-server @@ -55,11 +39,41 @@ * please remove it before going online! ! ! */ import { mockXHR } from '../mock' + +import echarts from 'echarts' + +import JsonExcel from 'vue-json-excel' +// ���������vue��������� +Vue.prototype.$clipboard = clipboard +Vue.use(AMap) +AMap.initAMapApiLoader({ + key: 'f4ba1c4d94654309b97a557d41857b48', + plugin: [ + 'AMap.moveAnimation', + 'AMap.Autocomplete', + 'AMap.PlaceSearch', + 'AMap.Scale', + 'AMap.OverView', + 'AMap.ToolBar', + 'AMap.MapType', + 'AMap.PolyEditor', + 'AMap.CircleEditor', + 'AMap.DistrictSearch', + 'AMap.Geolocation' + ], + // ������������ sdk ��������� 1.4.4 + v: '1.4.4' +}) +window._AMapSecurityConfig = { + securityJsCode: 'ef9c2027d42f060b979814c849eea7b9' +} +Vue.prototype.$AMap = AMap + +Vue.prototype.$request = request.service +Vue.prototype.$axiosRequest = request.reqServe if (process.env.NODE_ENV === 'production') { mockXHR() } - -import echarts from 'echarts' Vue.prototype.$Cookies = Cookies @@ -72,25 +86,26 @@ Vue.config.productionTip = false Vue.prototype.$axios = axios Vue.prototype.$Bus = Bus - -import JsonExcel from 'vue-json-excel' -Vue.component('downloadExcel', JsonExcel) +Vue.component('DownloadExcel', JsonExcel) function getServerConfig() { return new Promise((resolve, reject) => { - axios.get('/serverConfig.json').then((result) => { - // console.log(result) // ������������������������ - const config = result.data - for (const key in config) { - Vue.prototype[key] = config[key] - } - // ������������������������������������Vue��� - // console.log(Vue.prototype.BASE_ADDR) - resolve() - }).catch((error) => { - console.log(error) - reject() - }) + axios + .get('/serverConfig.json') + .then(result => { + // console.log(result) // ������������������������ + const config = result.data + for (const key in config) { + Vue.prototype[key] = config[key] + } + // ������������������������������������Vue��� + // console.log(Vue.prototype.BASE_ADDR) + resolve() + }) + .catch(error => { + console.log(error) + reject() + }) }) } @@ -118,11 +133,13 @@ for (const k in opt) { ret = new RegExp('(' + k + ')').exec(fmt) if (ret) { - fmt = fmt.replace(ret[1], (ret[1].length === 1) ? (opt[k]) : (opt[k].padStart(ret[1].length, '0'))) + fmt = fmt.replace( + ret[1], + ret[1].length === 1 ? opt[k] : opt[k].padStart(ret[1].length, '0') + ) } } return fmt } - init() -- Gitblit v1.8.0