diff --git a/package-lock.json b/package-lock.json index c5abda8..9b57a9e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,7 +17,6 @@ "css-color-function": "^1.3.3", "echarts": "^5.3.3", "element-plus": "2.2.27", - "fetch-jsonp": "^1.3.0", "highlight.js": "^11.6.0", "nprogress": "^0.2.0", "pinia": "^2.0.14", @@ -4072,11 +4071,6 @@ "reusify": "^1.0.4" } }, - "node_modules/fetch-jsonp": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/fetch-jsonp/-/fetch-jsonp-1.3.0.tgz", - "integrity": "sha512-hxCYGvmANEmpkHpeWY8Kawfa5Z1t2csTpIClIDG/0S92eALWHRU1RnGaj86Tf5Cc0QF+afSa4SQ4pFB2rFM5QA==" - }, "node_modules/file-entry-cache": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", diff --git a/package.json b/package.json index f0e7627..7ff83cc 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "vue": "^3.2.37", "vue-clipboard3": "^2.0.0", "vue-echarts": "^6.2.3", + "vue-jsonp": "^2.0.0", "vue-router": "^4.0.16", "vue3-video-play": "1.3.1-beta.6", "vuedraggable": "^4.1.0" diff --git a/src/views/store_product_unit/index.vue b/src/views/store_product_unit/index.vue index a3da56e..db359cd 100644 --- a/src/views/store_product_unit/index.vue +++ b/src/views/store_product_unit/index.vue @@ -93,18 +93,12 @@ import { timeFormat } from '@/utils/util' import { apicityLists, apiAreaLists, apiStreetLists, apigetProvinceLists } from "@/api/address" import myMap from "./myMap/index.vue" import axios from 'axios'; +import { jsonp } from "vue-jsonp" -axios.get(`https://apis.map.qq.com/ws/place/v1/search?boundary=nearby(40.040589,116.273543,1000)&keyword=公园&page_size=10&page_index=1&key=SMJBZ-WCHK4-ZPZUA-DSIXI-XDDVQ-XWFX7`) - .then(function (response) { - console.log(54545) - }) - .catch(function (error) { - // 处理错误情况 - }) - .finally(function () { - // 总是会执行 - }); - +jsonp('https://apis.map.qq.com/ws/location/v1/ip?ip=111.206.145.41&key=V4LBZ-UKCHA-EUNK7-CUH4F-HOXVO-YTF56&output=jsonp').then(res => { + console.log(res) +}) +// const formRef = shallowRef() const activeName = ref('first') // 地址 diff --git a/vite.config.ts b/vite.config.ts index 5757579..c31ada4 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -17,11 +17,6 @@ export default defineConfig({ host: '0.0.0.0', open: true, port: 8787, - proxy: { - '/ws': { - target: 'https://apis.map.qq.com/', - } - } }, plugins: [ vue(),