增加credentials: 'include',参数即可带cookie发请求示例:fetch('./api.php?action=getJson', {method: 'POST',credentials: 'include',headers:{'Content-Type': 'application/x-www-form-urlencoded'},body: 'test=test'})