Skip to content

Commit 5116cc5

Browse files
author
杜美瑶
committed
修复资源中心无法查询的bug (原因是数组类型的没有编码 造成后端无法解析)--reviewed by xujm
1 parent 43092aa commit 5116cc5

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

examples/leaflet/iPortalQueryResources.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,19 @@ <h5 class='panel-title text-center' data-i18n="resources.title_iPortalQueryResou
202202
queryResouces(queryParams);
203203
});
204204

205+
// 编码请求参数中的数组
206+
function encodeResquestURI(obj) {
207+
for(let key in obj) {
208+
if(obj[key] instanceof Array) {
209+
obj[key] = encodeURI(obj[key]);
210+
}
211+
}
212+
return obj;
213+
}
214+
205215
// 查询iPortal中的资源
206216
function queryResouces(queryParams) {
217+
var queryParams = encodeResquestURI(queryParams);
207218
iPortal.queryResources(queryParams).then(function (resourcesReslut) {
208219
//返回的结果集,需要查看可打开下行代码
209220
// console.log(resourcesReslut);

examples/openlayers/iPortalQueryResources.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,19 @@ <h5 class='panel-title text-center' data-i18n="resources.title_iPortalQueryResou
202202
queryResouces(queryParams);
203203
});
204204

205+
// 编码请求参数中的数组
206+
function encodeResquestURI(obj) {
207+
for(let key in obj) {
208+
if(obj[key] instanceof Array) {
209+
obj[key] = encodeURI(obj[key]);
210+
}
211+
}
212+
return obj;
213+
}
214+
205215
// 查询iPortal中的资源
206216
function queryResouces(queryParams) {
217+
var queryParams = encodeResquestURI(queryParams);
207218
iPortal.queryResources(queryParams).then(function (resourcesReslut) {
208219
//返回的结果集,需要查看可打开下行代码
209220
// console.log(resourcesReslut);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy