/**XML请求工具 */ export default class XMLHttp{ /**XML 请求 */ static Request(url:string,Back:Function,ErrorBack?:Function){ let xhr: XMLHttpRequest = new XMLHttpRequest(); xhr.open('GET', url, true); xhr.onreadystatechange = () => { if (xhr.readyState === 4 && (xhr.status >= 200 && xhr.status < 300)) { if (xhr.responseText.length > 0) { Back(xhr.responseText) } else { Back(null) } } } xhr.onerror = () => { Back(null) } xhr.send(); } }