From f939166955630db43fe0850b323d4b3e126a75bd Mon Sep 17 00:00:00 2001 From: quanyawei <401863037@qq.com> Date: Fri, 12 Jul 2024 14:35:08 +0800 Subject: [PATCH] fix: 高德密钥修改 --- src/main.ts | 90 ++++++++++++++++++++++++-------------------- 1 files changed, 49 insertions(+), 41 deletions(-) diff --git a/src/main.ts b/src/main.ts index fbcc071..4d418f9 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,39 +1,49 @@ -import Vue from 'vue'; -import axios from 'axios' -import { i18n } from './app/index'; +import Vue from "vue"; +import axios from "axios"; +import { i18n } from "./app/index"; -import App from './App.vue'; -import router from '@/route/router'; -import store from '@/store/store'; -import './registerServiceWorker'; - +import App from "./App.vue"; +import router from "@/route/router"; +import store from "@/store/store"; +import "./registerServiceWorker"; //������������ -import BaiduMap from 'vue-baidu-map' +import BaiduMap from "vue-baidu-map"; Vue.use(BaiduMap, { - ak: 'c4e73f2c6972766d6a54dffd2f501cac'//������������key -}) + ak: "c4e73f2c6972766d6a54dffd2f501cac", //������������key +}); -import AMap from 'vue-amap' -Vue.use(AMap) +import AMap from "vue-amap"; + AMap.initAMapApiLoader({ - key: 'f4ba1c4d94654309b97a557d41857b48', - plugin: ['AMap.moveAnimation', 'AMap.PlaceSearch', 'AMap.Scale', - 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType', 'AMap.PolyEditor', 'AMap.CircleEditor', - 'AMap.DistrictSearch', 'AMap.Geocoder', 'AMap.Autocomplete'], + key: "f4ba1c4d94654309b97a557d41857b48", + securityJsCode: "ef9c2027d42f060b979814c849eea7b9", + plugin: [ + "AMap.moveAnimation", + "AMap.PlaceSearch", + "AMap.Scale", + "AMap.OverView", + "AMap.ToolBar", + "AMap.MapType", + "AMap.PolyEditor", + "AMap.CircleEditor", + "AMap.DistrictSearch", + "AMap.Geocoder", + "AMap.Autocomplete", + ], // ������������ sdk ��������� 1.4.4 - v: '1.4.4' -}) - + v: "1.4.4", +}); +Vue.use(AMap); // ������������������ -import { preloaderFinished } from './util/preloader'; +import { preloaderFinished } from "./util/preloader"; preloaderFinished(); -import Startup from '@/core/Startup'; +import Startup from "@/core/Startup"; Vue.config.productionTip = false; -import './directives/index'; +import "./directives/index"; // ������vue������ const app = new Vue({ @@ -43,25 +53,23 @@ render: (h) => h(App), }); // ������������������ -Startup.bootstrap().then( - (res: any) => { - // ���vue������������ #app��� - app.$mount('#app'); +Startup.bootstrap().then((res: any) => { + // ���vue������������ #app��� + app.$mount("#app"); - // app������ - (window as any).appBootstrap(); + // app������ + (window as any).appBootstrap(); - // ������app������ - store.commit('app/appName', res.data.app); + // ������app������ + store.commit("app/appName", res.data.app); - // ���storage������������token������������������������token������ - const initToken = app.$ss.get('token'); - if (initToken != null) { - store.commit('user/loginSuccess', { token: initToken }); - // ������acl������ - store.dispatch('acl/login', { username: initToken }); - } - }, -); + // ���storage������������token������������������������token������ + const initToken = app.$ss.get("token"); + if (initToken != null) { + store.commit("user/loginSuccess", { token: initToken }); + // ������acl������ + store.dispatch("acl/login", { username: initToken }); + } +}); -export default app +export default app; -- Gitblit v1.8.0