const { getDBConnection } = require('./file-utils'); // 查询Plane表中的所有飞机 function getPlanes() { try { const db = getDBConnection(true); // 查询所有飞机 const planes = db.prepare(` SELECT PlaneName, Description, Icon FROM 'Plane' ORDER BY PlaneName `).all(); return planes; } catch (error) { console.error('获取飞机列表数据失败:', error.message); throw error; } } // 获取所有用户信息 function getUsers() { try { const db = getDBConnection(true); const users = db.prepare(` SELECT id, username, password, access_level, full_name, phone, email, department, position FROM users ORDER BY id ASC `).all(); return users; } catch (error) { console.error('获取用户信息失败:', error); throw error; } } module.exports = { getPlanes, getUsers };