From c476e6d6601f95615d2cdbbc1c91406005d6b4d8 Mon Sep 17 00:00:00 2001 From: xuechunyuan <17853500702@163.com> Date: Tue, 10 Jan 2023 16:14:32 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BD=A6=E8=BE=86=E5=AE=9A=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/base.js | 6 ++++++ vue.config.js | 5 +++++ 2 files changed, 11 insertions(+) create mode 100644 src/api/base.js diff --git a/src/api/base.js b/src/api/base.js new file mode 100644 index 0000000..d2aa226 --- /dev/null +++ b/src/api/base.js @@ -0,0 +1,6 @@ +import request from '@/util/axios' + +export const queryWeath = () => request({ + url: '/weather/v1/?district_id=371122&data_type=all&ak=GUGV9zeuAOeD4MrCwd1MeMkcae15vQ1e', + method: 'get', +}); diff --git a/vue.config.js b/vue.config.js index 6f7493a..b8c2a6c 100644 --- a/vue.config.js +++ b/vue.config.js @@ -24,6 +24,11 @@ module.exports = defineConfig({ '^/gatewayapi': '' } }, + '/weather': { + target: 'https://api.map.baidu.com', + changeOrigin: true, + ws: true, + }, } } });