企业核心用户中心系统

项目简介

企业核心用户中心系统,基于SpringBoot后端+React前端的全栈项目,实现了用户注册、登录、查询等基础功能。

项目设计

技术选型

前端

主要运用阿里Ant Design生态

  • HTML + CSS + JavaScript
  • React开发框架
  • Ant Design Pro 项目模板
  • Ant Design端组件库
  • Umi开发框架
  • Umi Request请求库
  • 正向和反向代理

后端

  • Java编程语言
  • Spring + SpringMVC + SpringBoot框架
  • MyBatis + MyBatis Plus数据访问框架
  • MySQL数据库
  • jUnit单元测试库
  • Maven

部署

  • Nginx Web服务器
  • Docker容器

前端初始化

安装JavaScript运行时环境Node.js,见「手把手教你安装Node.js

引入Ant Design组件,见「手把手教你安装Ant Design Pro

后端初始化

安装MySQL并测试连接数据库,见「手把手教你安装MySQL

用IntelliJ IDEA进行后端项目创建和初始化

*

功能实现

1.数据库设计

创建数据库db_user_center

1
create database db_user_center;

创建用户表user

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
create table user
(
id bigint auto_increment comment '账号' primary key,
userAccount varchar(256) null comment '登陆账号',
userName varchar(256) null comment '用户名',
avatarUrl varchar(1024) null comment '头像',
gender tinyint null comment '性别',
userPassword varchar(256) default '123456' not null comment '密码',
phone varchar(128) null comment '电话',
email varchar(512) null comment '邮箱',
userStatus int default 0 not null comment '账号状态',
createTime datetime default CURRENT_TIMESTAMP null comment '创建日期',
updateTime datetime default CURRENT_TIMESTAMP null comment '更新时间',
isDelete tinyint default 0 null comment '是否删除',
userRole int default 0 null comment '身份'
) comment '用户表';

信息录入

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
insert into db_user_center.user
(id, userAccount, userName, avatarUrl, gender, userPassword, phone, email, userStatus, createTime, updateTime, isDelete, userRole)
VALUES
(1, '111111', '老蔡编程', 'https://ycyyg.space/img/avatar.jpg', 1, '1f25bf881db4076846c2e943403d3f03', NULL, NULL, 0, '2025-01-25 22:03:28', '2025-01-25 22:03:28', 0, 1),

(75, 'user001', 'Alice', 'https://example.com/avatar1.png', 0, '1f25bf881db4076846c2e943403d3f03', '12345678901', 'alice@example.com', 0, '2025-01-28 17:37:36', '2025-01-28 17:37:36', 0, 0),

(76, 'user002', 'Bob', 'https://example.com/avatar2.png', 1, '1f25bf881db4076846c2e943403d3f03', '12345678902', 'bob@example.com', 0, '2025-01-28 17:37:36', '2025-01-28 17:37:36', 0, 1),

(77, 'user003', 'Charlie', 'https://example.com/avatar3.png', 1, '1f25bf881db4076846c2e943403d3f03', '12345678903', 'charlie@example.com', 0, '2025-01-28 17:37:36', '2025-01-28 17:37:36', 0, 0),

(78, 'user004', 'Daisy', 'https://example.com/avatar4.png', 0, '1f25bf881db4076846c2e943403d3f03', '12345678904', 'daisy@example.com', 0, '2025-01-28 17:37:36', '2025-01-28 17:37:36', 0, 1),

(79, 'user005', 'Eve', 'https://example.com/avatar5.png', 0, '1f25bf881db4076846c2e943403d3f03', '12345678905', 'eve@example.com', 0, '2025-01-28 17:37:36', '2025-01-28 17:37:36', 0, 0),

(80, 'user006', 'Frank', 'https://example.com/avatar6.png', 1, '1f25bf881db4076846c2e943403d3f03', '12345678906', 'frank@example.com', 0, '2025-01-28 17:37:36', '2025-01-28 17:37:36', 0, 1),

(81, 'user007', 'Grace', 'https://example.com/avatar7.png', 0, '1f25bf881db4076846c2e943403d3f03', '12345678907', 'grace@example.com', 0, '2025-01-28 17:37:36', '2025-01-28 17:37:36', 0, 0);

使用MybatisX插件生成包含数据库表字段的实体类

2.登录注册

测试

1.数据库操作

代码提交

项目部署

补充

项目依赖

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>4.0.1</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.ycyyg</groupId>
<artifactId>UserCenter</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>UserCenter</name>
<description>UserCenter</description>
<url/>
<licenses>
<license/>
</licenses>
<developers>
<developer/>
</developers>
<scm>
<connection/>
<developerConnection/>
<tag/>
<url/>
</scm>
<properties>
<java.version>17</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webmvc</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>4.0.1</version>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-spring-boot4-starter</artifactId>
<version>3.5.15</version>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webmvc-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter-test</artifactId>
<version>4.0.1</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
</path>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>

</project>