我一直收到错误消息“error:运算符不存在:text = bigint”。任何建议都会有帮助!谢谢。如果你知道如何检查令牌是否存在,那也会很有帮助,因为我正在传递它。下面是我的代码:
const bcrypt = require("bcrypt");
const client = require("../configs/database");
const jwt = require("jsonwebtoken");
exports.updateemail = async (req, res) => {
const {
id,
newemail,
cid
} = req.body;
const query = "UPDATE users SET (email) = ("+newemail+") WHERE id = "+id+" AND cid = "+cid+"";
try {
const res = await client.query(query)
res.status(200).send({ message: 'Success' });
} catch (err) {
console.log(err.stack)
return false;
}
}
1条答案
按热度按时间brgchamk1#
我想出了这个解决方案,它的工作。