# springsecurity **Repository Path**: it00zyq/springsecurity ## Basic Information - **Project Name**: springsecurity - **Description**: 个人学习springboot + springsecurity + JWT 的demo - **Primary Language**: Java - **License**: MulanPSL-1.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 1 - **Created**: 2021-01-15 - **Last Updated**: 2021-02-17 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # springsecurity #### 介绍 ``` 个人学习springboot + springsecurity + JWT 的demo ``` #### 软件架构 ``` config 关于SpringSecurity的配置 controller 用于测试的控制层 entity 数据库对应实体类 exception 自定义异常 fillers 拦截器 handles 处理器 mapper 持久层接口 security 安全UserDetailsService实现 service 服务层 utils 工具类 ``` #### 安装教程 ``` 配置yml中的数据源信息即可使用 ``` #### 建表SQL ```sql DROP TABLE IF EXISTS `security_user`; CREATE TABLE `security_user` ( `user_id` int NOT NULL AUTO_INCREMENT, `user_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, PRIMARY KEY (`user_id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of security_user -- ---------------------------- INSERT INTO `security_user` VALUES (1, 'zyq', '1234'); -- ---------------------------- -- Table structure for security_user_auth -- ---------------------------- DROP TABLE IF EXISTS `security_user_auth`; CREATE TABLE `security_user_auth` ( `id` int NOT NULL, `role_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, `user_id` int NULL DEFAULT NULL, PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of security_user_auth -- ---------------------------- INSERT INTO `security_user_auth` VALUES (1, 'ROLE_ADMIN', '管理角色', 1); INSERT INTO `security_user_auth` VALUES (2, 'ROLE_SUPER', '超级权限', 1); INSERT INTO `security_user_auth` VALUES (3, 'LOGIN', '登录权限', 1); ```