const { sequelize } = require('../config/database');

async function checkUsers() {
  try {
    const [users] = await sequelize.query('SELECT id, username, real_name FROM users LIMIT 10');
    console.log('用户列表:');
    if (users.length === 0) {
      console.log('❌ 没有找到任何用户数据');
    } else {
      users.forEach(user => {
        console.log(`- ID: ${user.id}, 用户名: ${user.username}, 姓名: ${user.real_name}`);
      });
    }
  } catch (error) {
    console.error('❌ 查询用户失败:', error.message);
  } finally {
    await sequelize.close();
  }
}

checkUsers();