Browse Source

🐞 fix: 修复无法绑定账户的问题

Pchen. 1 month ago
parent
commit
7128ea3d49
1 changed files with 3 additions and 2 deletions
  1. 3 2
      lib/Lepao/Mcp.js

+ 3 - 2
lib/Lepao/Mcp.js

@@ -39,6 +39,7 @@ class Mcp {
                 return '缺少参数'
 
             this.logger.info(`MCP接收绑定账号请求:${sender},绑定码:${bind_code}`)
+            let umo = `QQ2749761853:FriendMessage:${sender}`
             let sql = `
                 SELECT 
                     f.student_num, a.name, f.bot_account
@@ -60,9 +61,9 @@ class Mcp {
             }
 
             let insertSql = `
-                UPDATE lepao_extra SET bot_account = ? WHERE bind_code = ?
+                UPDATE lepao_extra SET bot_account = ?, bot_umo = ? WHERE bind_code = ?
             `
-            let insertRows = await db.query(insertSql, [sender, bind_code])
+            let insertRows = await db.query(insertSql, [sender, umo, bind_code])
             if (!insertRows || insertRows.affectedRows !== 1)
                 return '系统出错,请稍后再试'
             return `绑定成功,姓名:${rows[0].name ?? '未更新,请使用乐跑登录器更新账号信息'},学号:${rows[0].student_num}`