From 8bf7b85c2e98bfa786d5125424f7c2b31b50bac5 Mon Sep 17 00:00:00 2001 From: chenjinsong <523037378@qq.com> Date: Fri, 3 Feb 2023 11:08:35 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=9C=B0=E5=9B=BE?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E8=B7=AF=E5=BE=84=E6=8B=BC=E5=86=99=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit ec486fe9308739953bea036b819140ba2781d9cc) --- src/utils/api.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/utils/api.js b/src/utils/api.js index 75fed64d..6eae13d4 100644 --- a/src/utils/api.js +++ b/src/utils/api.js @@ -318,11 +318,12 @@ export async function getI18n () { /* 获得原始的3611-2 json字符串数据 */ export async function getIso36112JsonData (suffix) { + const url = `${window.location.protocol}//${window.location.host}/geojson/${suffix}.json` const request = new Promise(resolve => { - axios({ - url: `${window.location.protocol}//${window.location.host}:${window.location.port}/geojson/${suffix}.json` - }).then(response => { + axios({ url }).then(response => { resolve(response.data || response || null) + }).catch(err => { + console.error(err) }) }) return await request