更新密码
This commit is contained in:
parent
f777182f96
commit
e02f62caec
|
|
@ -26,5 +26,5 @@ CREATE INDEX idx_t_user_del_flag ON t_user(del_flag);
|
||||||
|
|
||||||
-- 插入默认管理员用户(密码:admin123)
|
-- 插入默认管理员用户(密码:admin123)
|
||||||
INSERT INTO t_user (username, password, nickname, email, phone, status, role, del_flag)
|
INSERT INTO t_user (username, password, nickname, email, phone, status, role, del_flag)
|
||||||
VALUES ('admin', '$2a$10$eT5Qe9C7J9P8X6H4L3K2J1I0H9G8F7E6D5C4B3A2Z1Y0X9W8V7U6T5', '管理员', 'admin@example.com', '13800138000', 1, 'admin', 0)
|
VALUES ('admin', 'oFcu0MX+JLxy+5RpiL3hhBhB2J4eCP7Ut9J7dJSMF9tT+Men', '管理员', 'admin@example.com', '13800138000', 1, 'admin', 0)
|
||||||
ON DUPLICATE KEY UPDATE nickname='管理员', email='admin@example.com', phone='13800138000', status=1, role='admin', del_flag=0;
|
ON DUPLICATE KEY UPDATE nickname='管理员', email='admin@example.com', phone='13800138000', status=1, role='admin', del_flag=0;
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,6 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
||||||
if (user == null) {
|
if (user == null) {
|
||||||
throw new RuntimeException("用户名或密码错误");
|
throw new RuntimeException("用户名或密码错误");
|
||||||
}
|
}
|
||||||
System.out.println(passwordEncoder.encode("admin123"));
|
|
||||||
// 验证密码
|
// 验证密码
|
||||||
if (!passwordEncoder.matches(loginRequest.getPassword(), user.getPassword())) {
|
if (!passwordEncoder.matches(loginRequest.getPassword(), user.getPassword())) {
|
||||||
throw new RuntimeException("用户名或密码错误");
|
throw new RuntimeException("用户名或密码错误");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue