-- 检查是否存在 admin 用户
SELECT * FROM sys_user WHERE username = 'admin';

-- 如果不存在或密码错误，执行以下插入/更新
-- 密码是 admin123，使用 BCrypt 加密
INSERT INTO sys_user (username, password, nickname, status, create_time, update_time) 
VALUES ('admin', '$2a$10$N.zmdr9k7uOCQb376NoUnuTJ8iAt6Z5EHsM8lE9lBOsl7iAt6Z5EO', '管理员', 1, NOW(), NOW())
ON DUPLICATE KEY UPDATE 
password = '$2a$10$N.zmdr9k7uOCQb376NoUnuTJ8iAt6Z5EHsM8lE9lBOsl7iAt6Z5EO',
status = 1,
update_time = NOW();
