数据库openId名称换为open_id

This commit is contained in:
2025-11-17 08:46:54 +08:00
parent c6a974fa8c
commit 0b2e07c52c

View File

@@ -459,7 +459,7 @@ app.post("/getuserByopenid", async (req, res) => {
// 查询 user_name // 查询 user_name
const [rows] = await pool.query( const [rows] = await pool.query(
"SELECT * FROM sys_user WHERE openId = ?", "SELECT * FROM sys_user WHERE open_id = ?",
[userId] [userId]
); );
if (rows.length > 0) { if (rows.length > 0) {
@@ -469,7 +469,7 @@ app.post("/getuserByopenid", async (req, res) => {
} else { } else {
// 用户不存在,插入新用户 // 用户不存在,插入新用户
const [result] = await pool.query( const [result] = await pool.query(
"INSERT INTO sys_user (openId,user_name,nick_name) VALUES (?,?,?)", "INSERT INTO sys_user (open_id,user_name,nick_name) VALUES (?,?,?)",
[userId,userId,userId] [userId,userId,userId]
); );
console.log(result,"udgwehvdh") console.log(result,"udgwehvdh")