- 博客(6)
- 收藏
- 关注
原创 Vue数组操作方法
// 求总价 return this.list.reduce((sum, obj) => sum += obj.price, 0)// 删除指定id的数据delFn(id){ // 通过id找到这条数据在数组中下标 let index = this.list.findIndex(obj => obj.id === id) this.list.splice(index, 1) }...
2021-10-02 08:08:39
281
原创 Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
node中express的,res.send() 或res.json()这类客户端返回的方法仅返回一次,如果多次返回就会出现这个错误!
2021-09-19 17:20:56
543
原创 TypeError: res.send is not a function
node操作数据时,函数的res不能与后面的res一样,应该改为results,否则会报错。db.query(sqlStr,userinfo.username,(err,res)=>{//执行sql语句失败if(err){returnres.send({status:1,msg:'执行sql语句失败'})...
2021-09-19 17:01:09
726
1
原创 安装express-jwt报错解决方案
npm install出现”Unexpected end of JSON input while parsing near”的错误。运行 npm cache clean --force
2021-09-19 11:50:11
309
原创 2021-07-18 JWT案例运行报错
使用 jwt 报错:algorithms should be set:导致报错的语句(node_modules\_express-jwt@6.0.0@express-jwt\lib\index.js:22):if (!options.algorithms) throw new Error('algorithms should be set')1原因是:2020.7.7日jwt更新之后,安装的express-jwt模块会默认为6.0.0版本,更新后的jwt需要在配置中加入algorithms属
2021-07-18 13:15:18
317
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人