From afb9e7c8c9865be6a73d19e35819b5aa6b8afbdd Mon Sep 17 00:00:00 2001
From: quanyawei <401863037@qq.com>
Date: Mon, 17 Jun 2024 15:05:29 +0800
Subject: [PATCH] fix: bug修改
---
src/main.js | 90 ++++++++++++++++++++++++++------------------
1 files changed, 53 insertions(+), 37 deletions(-)
diff --git a/src/main.js b/src/main.js
index 01a4bb2..2e04d03 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: 'c4e73f2c6972766d6a54dffd2f501cac',
+ 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: '20fcbbc1782d2853f433831e61fab769'
+}
+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()
+ })
})
}
@@ -104,7 +119,6 @@
render: h => h(App)
}).$mount('#app')
}
-
Vue.prototype.dateTypeFormat = function (fmt, date) {
let ret
const opt = {
@@ -119,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