From ddb1df24b17dd22e1fa088fa9fe8573913baec33 Mon Sep 17 00:00:00 2001
From: 刘嘉威 <daidaibg@163.com>
Date: 星期五, 24 二月 2023 15:06:40 +0800
Subject: [PATCH] perf: 请求项目路径下文件问题
---
src/views/index/center-map.vue | 2 +-
src/api/api.ts | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/api/api.ts b/src/api/api.ts
index 0d6e66e..9f26064 100644
--- a/src/api/api.ts
+++ b/src/api/api.ts
@@ -1,7 +1,7 @@
/*
* @LastEditors: Please set LastEditors
- * @LastEditTime: 2022-10-25 15:34:56
+ * @LastEditTime: 2023-02-24 15:04:36
*/
import axios from 'axios';
@@ -114,7 +114,7 @@
*/
export const GETNOBASE = async (url: string, params?: Params): Promise<any> => {
try {
- const data = await axios.get(location.pathname+url, {
+ const data = await axios.get(url, {
params: params,
});
return data;
diff --git a/src/views/index/center-map.vue b/src/views/index/center-map.vue
index 052b475..a406a02 100644
--- a/src/views/index/center-map.vue
+++ b/src/views/index/center-map.vue
@@ -55,7 +55,7 @@
mapjson = mapjson.geoJSON;
resolve(mapjson);
} else {
- mapjson = await GETNOBASE(`map-geojson/${regionCode}.json`).then(
+ mapjson = await GETNOBASE(`./map-geojson/${regionCode}.json`).then(
(data) => data
);
code.value=regionCode
--
Gitblit v1.8.0