Thanks you! it's working!
Apparently Arcgis Experience Builder already add interceptor at file
client\dist\jimu-arcgis\index.js (it's built minified)
(e=re.request.interceptors)||void 0===e||e.push({after:e=>{var t,i;(null===(t=null==e?void 0:e.url)||void 0===t?void 0:t.indexOf("/rest/info"))&&(null===(i=null==e?void 0:e.data)||void 0===i?void 0:i.owningSystemUrl)&&this.registOAuthInfo(e.data.owningSystemUrl)}}),
but they add interceptor without urls property
so even if I add urls
esriConfig.request.interceptors.push({
urls: /FeatureServer\/\d+/,
after: function (response) {
response.data.supportedQueryFormats = "JSON";
}
});
It's not intercept.
I tried to add urls to the first interceptor
esriConfig.request.interceptors[0].urls = /.*?/
or
esriConfig.request.interceptors[0].urls = /.*/
also not working
But
when tried
esriConfig.request.interceptors[0].urls = /blalba.*/
It's seems like if hit the first interceptor it's not continue to the second one.
Meanwhile I do
esriConfig.request.interceptors.push({
urls: /FeatureServer\/\d+/,
after: function (response) {
debugger;
response.data.supportedQueryFormats = "JSON";
}
});
esriConfig.request.interceptors.reverse();
Any suggestions?