提交 a5a6e87a authored 作者: lidongxu's avatar lidongxu

refactor(location): 修改:地理位置逆解析使用自己的后台接口代替腾讯接口_解决 cors 问题

上级 2cc7ace3
...@@ -24,7 +24,4 @@ VITE_APP_REPORT_SHARE_PREVIEW_URL = '#/report' ...@@ -24,7 +24,4 @@ VITE_APP_REPORT_SHARE_PREVIEW_URL = '#/report'
VITE_APP_REPORT_EDIT_URL = '#/report/jmreport/index' VITE_APP_REPORT_EDIT_URL = '#/report/jmreport/index'
# 促销计划上报模板表格 # 促销计划上报模板表格
VITE_APP_PLAN_TEMPLATE_EXCEL = 'https://link-promotion.oss-cn-shanghai.aliyuncs.com/file/%E6%96%B0%E5%A2%9E%E6%88%96%E4%BF%AE%E6%94%B9%E8%AE%A1%E5%88%92-%E6%A8%A1%E6%9D%BF4.0.xlsx' VITE_APP_PLAN_TEMPLATE_EXCEL = 'https://link-promotion.oss-cn-shanghai.aliyuncs.com/file/%E6%96%B0%E5%A2%9E%E6%88%96%E4%BF%AE%E6%94%B9%E8%AE%A1%E5%88%92-%E6%A8%A1%E6%9D%BF4.0.xlsx'
\ No newline at end of file
# 腾讯地图接口地址
VITE_APP_TENCENT_MAP_API = '/tencent_map_api'
\ No newline at end of file
...@@ -23,7 +23,4 @@ VITE_APP_REPORT_SHARE_PREVIEW_URL = '#/report' ...@@ -23,7 +23,4 @@ VITE_APP_REPORT_SHARE_PREVIEW_URL = '#/report'
VITE_APP_REPORT_EDIT_URL = '#/report/jmreport/index' VITE_APP_REPORT_EDIT_URL = '#/report/jmreport/index'
# 促销计划上报模板表格 # 促销计划上报模板表格
VITE_APP_PLAN_TEMPLATE_EXCEL = 'https://link-promotion.oss-cn-shanghai.aliyuncs.com/file/%E6%96%B0%E5%A2%9E%E6%88%96%E4%BF%AE%E6%94%B9%E8%AE%A1%E5%88%92-%E6%A8%A1%E6%9D%BF4.0.xlsx' VITE_APP_PLAN_TEMPLATE_EXCEL = 'https://link-promotion.oss-cn-shanghai.aliyuncs.com/file/%E6%96%B0%E5%A2%9E%E6%88%96%E4%BF%AE%E6%94%B9%E8%AE%A1%E5%88%92-%E6%A8%A1%E6%9D%BF4.0.xlsx'
\ No newline at end of file
# 腾讯地图接口地址
VITE_APP_TENCENT_MAP_API = 'https://apis.map.qq.com/ws/geocoder/v1'
\ No newline at end of file
...@@ -22,7 +22,4 @@ VITE_APP_REPORT_SHARE_PREVIEW_URL = '#/report' ...@@ -22,7 +22,4 @@ VITE_APP_REPORT_SHARE_PREVIEW_URL = '#/report'
VITE_APP_REPORT_EDIT_URL = '#/report/jmreport/index' VITE_APP_REPORT_EDIT_URL = '#/report/jmreport/index'
# 促销计划上报模板表格 # 促销计划上报模板表格
VITE_APP_PLAN_TEMPLATE_EXCEL = 'https://link-promotion.oss-cn-shanghai.aliyuncs.com/file/%E6%96%B0%E5%A2%9E%E6%88%96%E4%BF%AE%E6%94%B9%E8%AE%A1%E5%88%92-%E6%A8%A1%E6%9D%BF4.0.xlsx' VITE_APP_PLAN_TEMPLATE_EXCEL = 'https://link-promotion.oss-cn-shanghai.aliyuncs.com/file/%E6%96%B0%E5%A2%9E%E6%88%96%E4%BF%AE%E6%94%B9%E8%AE%A1%E5%88%92-%E6%A8%A1%E6%9D%BF4.0.xlsx'
\ No newline at end of file
# 腾讯地图接口地址
VITE_APP_TENCENT_MAP_API = 'https://apis.map.qq.com/ws/geocoder/v1'
\ No newline at end of file
...@@ -2,11 +2,9 @@ import request from '@/utils/request' ...@@ -2,11 +2,9 @@ import request from '@/utils/request'
// 逆地址编码 // 逆地址编码
export const getLocation = (params) => { export const getLocation = (params) => {
return request({ return request({
baseURL: import.meta.env.VITE_APP_TENCENT_MAP_API, url: '/system/tencent/libs/address',
url: '/',
params: { params: {
location: params.lat + ',' + params.lng, // GCJ02坐标系(经度,维度) location: params.lat + ',' + params.lng // GCJ02坐标系(经度,维度)
key: 'UTEBZ-UJ3KG-OORQO-QT3PT-JDWU7-YRBZA'
} }
}) })
} }
\ No newline at end of file
...@@ -22,11 +22,6 @@ export default defineConfig(({ mode, command }) => { ...@@ -22,11 +22,6 @@ export default defineConfig(({ mode, command }) => {
host: true, host: true,
open: true, open: true,
proxy: { proxy: {
'/tencent_map_api': {
target: 'https://apis.map.qq.com/ws/geocoder/v1',
changeOrigin: true,
rewrite: (p) => p.replace(/^\/tencent_map_api/, '')
},
'/dev-api': { '/dev-api': {
target: 'http://192.168.100.55:8080', target: 'http://192.168.100.55:8080',
// target: 'https://sfa-qa.wxl66.cn/api', // target: 'https://sfa-qa.wxl66.cn/api',
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论