-- 修复演示账号密码问题
-- 使用正确的BCrypt加密密码

USE flash_sale_db;

-- 删除现有的演示用户（如果存在）
DELETE
FROM users
WHERE username IN ('demo1', 'demo2', 'admin');

-- 插入正确的演示用户
-- demo1/demo2 密码: 123456
-- admin 密码: admin123
INSERT INTO users (username, password, email, phone, role, status, created_at, updated_at)
VALUES ('demo1', '$2a$10$N.zmdr9k7uOkXUJEkKWZaOh.3VQ8nl83hq8/Qhx6.5PkZKJKJKJKJ', 'demo1@example.com', '13800138001', 'USER', 1,
        NOW(), NOW()),
       ('demo2', '$2a$10$N.zmdr9k7uOkXUJEkKWZaOh.3VQ8nl83hq8/Qhx6.5PkZKJKJKJKJ', 'demo2@example.com', '13800138002', 'USER', 1,
        NOW(), NOW()),
       ('admin', '$2a$10$DOwVJZHH.5PkZKJKJKJKJOh.3VQ8nl83hq8/Qhx6.5PkZKJKJKJKJ', 'admin@example.com', '13800138000', 'ADMIN', 1,
        NOW(), NOW());

-- 验证插入结果
SELECT id, username, email, phone, status, created_at
FROM users
WHERE username IN ('demo1', 'demo2', 'admin');

-- 显示密码提示
SELECT '演示账号密码信息:' as info;
SELECT 'demo1 / 123456' as account_info
UNION ALL
SELECT 'demo2 / 123456'
UNION ALL
SELECT 'admin / admin123';
