在request得到response之后,通常这样书写:
其实是使用了短路与&&,如果response为undifined/null,就不再进行后续赋值,简化了较长的判断写法,又避免了报错。
ajaxService.get(***).then(function (response) { response && (*** = response.data); });