fetch交互
// fetch实现跨域
created () {
// fetch方式实现跨域
/*fetch('/api/user/getUser', {
method: 'POST',
mode: 'cors',
credentials: 'include',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({ id: 3 })
}).then(res => {
console.log(res)
})*/
}