fix(auth): 邮箱建号 INSERT 参数对齐——7 占位符传 5 值致 RangeError,补 email/expertise 两个占位符

This commit is contained in:
2026-11-17 00:07:19 +08:00
parent 9b4e97fafe
commit 0bab5f5f6c
+2 -2
View File
@@ -990,8 +990,8 @@ app.post('/auth/email/login', async (req, res) => {
const now = new Date().toISOString();
db.prepare(`
INSERT INTO users (id, has_account, openid, nickname, avatar_url, phone, position, industry, hometown, email, expertise, created_at, updated_at)
VALUES (?, 1, ?, ?, '', '', '', '', '', ?, ?, ?, ?)
`).run(userId, openid || '', `用户${email.slice(0, email.indexOf('@'))}`.slice(0, 20), now, now);
VALUES (?, 1, ?, ?, '', '', '', '', '', ?, '', ?, ?)
`).run(userId, openid || '', `用户${email.slice(0, email.indexOf('@'))}`.slice(0, 20), email, now, now);
user = db.prepare('SELECT * FROM users WHERE id = ?').get(userId);
}
} else if (openid && !user.openid) {