angular 解析 xml 完美import {parseStringPromise} from 'xml2js';this.http.get(apiurl+'?service='+encodeURIComponent(url)+'&ticket='+this.ticket,{responseType:'text'}).subscribe(resp=>{ console.log(resp.toString()) const jsonData=parseStringPromise(resp,{explicitArray: false, mergeAttrs: true}) console.log(jsonData);