Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

可以表结构 测试数据提供下? #6

Open
Light-Towers opened this issue Feb 4, 2020 · 3 comments
Open

可以表结构 测试数据提供下? #6

Light-Towers opened this issue Feb 4, 2020 · 3 comments

Comments

@Light-Towers
Copy link

麻烦提供下表结构、数据的DB文件

@ChenXbFrank
Copy link


-- 主机: 127.0.0.1
-- 服务器版本: 5.6.40 - MySQL Community Server (GPL)
-- 服务器操作系统: Win64
-- HeidiSQL 版本: 8.2.0.4675


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT /;
/
!40101 SET NAMES utf8 /;
/
!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 /;
/
!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;

-- 导出 test 的数据库结构
CREATE DATABASE IF NOT EXISTS test /*!40100 DEFAULT CHARACTER SET utf8 */;
USE test;

-- 导出 表 test.role 结构
CREATE TABLE IF NOT EXISTS role (
id int(11) NOT NULL AUTO_INCREMENT,
role_name varchar(255) DEFAULT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;

-- 正在导出表 test.role 的数据:~2 rows (大约)
DELETE FROM role;
/*!40000 ALTER TABLE role DISABLE KEYS /;
INSERT INTO role (id, role_name) VALUES
(1, 'ROLE_admin'),
(2, 'ROLE_user');
/
!40000 ALTER TABLE role ENABLE KEYS */;

-- 导出 表 test.user 结构
CREATE TABLE IF NOT EXISTS user (
id int(11) NOT NULL AUTO_INCREMENT,
username varchar(255) DEFAULT NULL,
password varchar(255) DEFAULT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;

-- 正在导出表 test.user 的数据:~2 rows (大约)
DELETE FROM user;
/*!40000 ALTER TABLE user DISABLE KEYS /;
INSERT INTO user (id, username, password) VALUES
(1, 'admin', '$2a$10$jH.e74/Oy41OfUsSgi3KQu5MlC/9ISytTS0mMl0YiXM0RdbfijmS.'),
(2, 'user', '$2a$10$jH.e74/Oy41OfUsSgi3KQu5MlC/9ISytTS0mMl0YiXM0RdbfijmS.');
/
!40000 ALTER TABLE user ENABLE KEYS */;

-- 导出 表 test.user_role 结构
CREATE TABLE IF NOT EXISTS user_role (
id int(11) NOT NULL AUTO_INCREMENT,
uid int(11) NOT NULL,
rid int(11) NOT NULL,
PRIMARY KEY (id),
UNIQUE KEY UK_q7oskmwmmyn5usc6cqsi2g28g (rid),
KEY FKe5x46iw9uaj34h12wkbvxj7k5 (uid),
CONSTRAINT FKe5x46iw9uaj34h12wkbvxj7k5 FOREIGN KEY (uid) REFERENCES user (id),
CONSTRAINT FKid0s4w8sbpgppnfro2ej3oana FOREIGN KEY (rid) REFERENCES role (id)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;

-- 正在导出表 test.user_role 的数据:~0 rows (大约)
DELETE FROM user_role;
/*!40000 ALTER TABLE user_role DISABLE KEYS /;
INSERT INTO user_role (id, uid, rid) VALUES
(1, 1, 1),
(2, 2, 2);
/
!40000 ALTER TABLE user_role ENABLE KEYS /;
/
!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') /;
/
!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) /;
/
!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;

@ChenXbFrank
Copy link

密码都是123456
image
我使用的是图中的加密方式

@ChenXbFrank
Copy link

@Autowired
public void globalUserDetails(AuthenticationManagerBuilder auth) throws Exception {
auth
.userDetailsService(myUserDetailsService())
.passwordEncoder(new BCryptPasswordEncoder());
//.passwordEncoder(new Md5PasswordEncoder());
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants