1.fetch是浏览器自带的,不需要安装或引用,可直接使用
fetch('/api/products') .then(response=>response.json()) .then(result=>{ ....//处理数据 })