diff options
| author | 陈劲松 <[email protected]> | 2023-02-03 03:09:18 +0000 |
|---|---|---|
| committer | 陈劲松 <[email protected]> | 2023-02-03 03:09:18 +0000 |
| commit | afab449f3accc5018392f85658087f37a2e31d31 (patch) | |
| tree | 43fedd9e814633644aad2efb65ed5e41e53bfae6 | |
| parent | ab146b5b15c7557d5c1273f83f4a3602c0fc2354 (diff) | |
| parent | 8bf7b85c2e98bfa786d5125424f7c2b31b50bac5 (diff) | |
Merge branch 'cherry-pick-ec486fe9' into 'dev'
fix: 修复地图资源路径拼写错误的问题
See merge request cyber-narrator/cn-ui!18
| -rw-r--r-- | src/utils/api.js | 7 |
1 files 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 |
