正常人使用axios的时候,要获取response中的cookie,正常写法是:
axios.post('xxx.url',params)
.then(res => {
console.log(res.headers['set-cookie'])
})
.catch(err => {
console.log(err)
})
但是!你会你发现你得到一个undefined!
惊不惊喜?意不意外?
正常人使用axios的时候,要获取response中的cookie,正常写法是:
axios.post('xxx.url',params)
.then(res => {
console.log(res.headers['set-cookie'])
})
.catch(err => {
console.log(err)
})
但是!你会你发现你得到一个undefined!
惊不惊喜?意不意外?
基本条件:安装并运行了MongoDB
现在项目下有三个文件(1.txt 2.txt 3.txt)内容分别为 “1”,“2”,“3”;
我们需要使用fs.readFile
方法来依次读取他们的内容