提交 749a509e authored 作者: 正反's avatar 正反

地址解析

上级 181719c2
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
"element-ui": "^2.15.2", "element-ui": "^2.15.2",
"qs": "^6.10.1", "qs": "^6.10.1",
"vue": "^2.6.11", "vue": "^2.6.11",
"vue-jsonp": "^2.0.0",
"vue-router": "^3.2.0", "vue-router": "^3.2.0",
"vuex": "^3.4.0", "vuex": "^3.4.0",
"wot-design": "^2.3.2" "wot-design": "^2.3.2"
......
import request from '../request/request' import request from '../request/request'
export function getAction(url,params){ export function getAction(url, params) {
return request({ return request({
method:'GET', method: 'GET',
url:url, url: url,
params:params params: params
}) })
} }
export function postAction(url,params){ export function postAction(url, params) {
return request({ return request({
method:'POST', method: 'POST',
url:url, url: url,
headers: { 'Content-Type': 'application/json;charset=UTF-8' }, headers: {
data:params 'Content-Type': 'application/json;charset=UTF-8'
}) },
data: params
})
}
//地址识别
export function recognizedata(url, params) {
return request({
method: 'POST',
url: url,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
},
data: params
})
} }
/** /**
* *
* @description 获取行政区信息API(来源:高德地图) * @description 获取行政区信息API(来源:高德地图)
...@@ -25,17 +37,17 @@ export function postAction(url,params){ ...@@ -25,17 +37,17 @@ export function postAction(url,params){
* @author Ras * @author Ras
* *
*/ */
export function getBoroughs(){ export function getBoroughs() {
let params = { let params = {
key:'2564f6ab105b9193d25f7a9b8e1facd9', key: '2564f6ab105b9193d25f7a9b8e1facd9',
address:'中国', address: '中国',
subdistrict: 3, subdistrict: 3,
extensions: 'base' extensions: 'base'
} }
let url = 'https://restapi.amap.com/v3/config/district' let url = 'https://restapi.amap.com/v3/config/district'
return request({ return request({
method:'GET', method: 'GET',
url:url, url: url,
params:params params: params
}) })
} }
\ No newline at end of file
...@@ -6,7 +6,6 @@ import ElementUI from 'element-ui'; ...@@ -6,7 +6,6 @@ import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css'; import 'element-ui/lib/theme-chalk/index.css';
import axios from 'axios' import axios from 'axios'
import qs from 'qs' import qs from 'qs'
Vue.use(ElementUI) Vue.use(ElementUI)
Vue.prototype.$axios = axios Vue.prototype.$axios = axios
Vue.prototype.$qs = qs Vue.prototype.$qs = qs
......
...@@ -23,7 +23,7 @@ const routes = [ ...@@ -23,7 +23,7 @@ const routes = [
] ]
const router = new VueRouter({ const router = new VueRouter({
mode: 'hash', mode: 'history',
routes routes
}) })
......
差异被折叠。
module.exports = { module.exports = {
// 基本路径 baseURL已经过时 // 基本路径 baseURL已经过时
publicPath: './', publicPath: './',
// 输出文件目录 // 输出文件目录
outputDir: 'dist', outputDir: 'dist',
// eslint-loader 是否在保存的时候检查 // eslint-loader 是否在保存的时候检查
lintOnSave: true, lintOnSave: true,
// use the full build with in-browser compiler? // use the full build with in-browser compiler?
// https://vuejs.org/v2/guide/installation.html#Runtime-Compiler-vs-Runtime-only // https://vuejs.org/v2/guide/installation.html#Runtime-Compiler-vs-Runtime-only
// compiler: false, // compiler: false,
// webpack配置 // webpack配置
// see https://github.com/vuejs/vue-cli/blob/dev/docs/webpack.md // see https://github.com/vuejs/vue-cli/blob/dev/docs/webpack.md
chainWebpack: () => {}, chainWebpack: () => {},
configureWebpack: () => {}, configureWebpack: () => {},
// vue-loader 配置项 // vue-loader 配置项
// https://vue-loader.vuejs.org/en/options.html // https://vue-loader.vuejs.org/en/options.html
// vueLoader: {}, // vueLoader: {},
// 生产环境是否生成 sourceMap 文件 // 生产环境是否生成 sourceMap 文件
productionSourceMap: true, productionSourceMap: true,
// css相关配置 // css相关配置
css: { css: {
// 是否使用css分离插件 ExtractTextPlugin // 是否使用css分离插件 ExtractTextPlugin
extract: true, extract: true,
// 开启 CSS source maps? // 开启 CSS source maps?
sourceMap: false, sourceMap: false,
// css预设器配置项 // css预设器配置项
loaderOptions: {}, loaderOptions: {},
// 启用 CSS modules for all css / pre-processor files. // 启用 CSS modules for all css / pre-processor files.
modules: false modules: false
}, },
// use thread-loader for babel & TS in production build // use thread-loader for babel & TS in production build
// enabled by default if the machine has more than 1 cores // enabled by default if the machine has more than 1 cores
parallel: require('os').cpus().length > 1, parallel: require('os').cpus().length > 1,
// 是否启用dll // 是否启用dll
// See https://github.com/vuejs/vue-cli/blob/dev/docs/cli-service.md#dll-mode // See https://github.com/vuejs/vue-cli/blob/dev/docs/cli-service.md#dll-mode
// dll: false, // dll: false,
// PWA 插件相关配置 // PWA 插件相关配置
// see https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-pwa // see https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-pwa
pwa: {}, pwa: {},
// webpack-dev-server 相关配置 // webpack-dev-server 相关配置
devServer: { devServer: {
// overlay: { // 让浏览器 overlay 同时显示警告和错误 // proxy: {
// warnings: true, // '/baiduApi': {
// errors: true // target: 'https://aip.baidubce.com', //访问地址
// }, // changeOrigin: true,
// host: "localhost", // secure: false, //只有代理https 地址需要次选项
// port: 8080, // 端口号 // pathRewrite: {
// https: false, // https:{type:Boolean} // '^/baiduApi': '/'
// open: false, //配置后自动启动浏览器 // }
// hotOnly: true, // 热更新 // },
// // proxy: 'http://localhost:8080', // 配置跨域处理,只有一个代理 // },
// proxy: { //配置多个代理 overlay: { // 让浏览器 overlay 同时显示警告和错误
// "/testIp": { warnings: true,
// target: "http://197.0.0.1:8088", errors: true
// changeOrigin: true, },
// ws: true,//websocket支持 host: "localhost",
// secure: false, port: 8080, // 端口号
// pathRewrite: { https: false, // https:{type:Boolean}
// "^/testIp": "/" open: false, //配置后自动启动浏览器
// } hotOnly: true, // 热更新
// }, // proxy: 'http://localhost:8080', // 配置跨域处理,只有一个代理
// "/elseIp": { proxy: { //配置多个代理
// target: "http://197.0.0.2:8088", // "/testIp": {
// changeOrigin: true, // target: "http://197.0.0.1:8088",
// //ws: true,//websocket支持 // changeOrigin: true,
// secure: false, // ws: true, //websocket支持
// pathRewrite: { // secure: false,
// "^/elseIp": "/" // pathRewrite: {
// } // "^/testIp": "/"
// }, // }
// } // },
}, // "/elseIp": {
// 第三方插件配置 // target: "http://197.0.0.2:8088",
pluginOptions: { // changeOrigin: true,
// ... // //ws: true,//websocket支持
} // secure: false,
} // pathRewrite: {
\ No newline at end of file // "^/elseIp": "/"
// },
// },
"/baiduApi": {
target: "https://aip.baidubce.com", //访问地址
changeOrigin: true,
ws: true,
secure: false, //只有代理https 地址需要次选项
pathRewrite: {
'^/baiduApi': '/'
}
},
}
},
// 第三方插件配置
pluginOptions: {
// ...
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论