Support login with email

This commit is contained in:
2023-12-20 14:55:30 +08:00
parent 60353906ad
commit e7c8311b83
13 changed files with 34 additions and 43 deletions

View File

@@ -6,10 +6,11 @@ create table if not exists t_user_info
user_id bigint not null comment '用户ID',
nickname varchar(50) null comment '昵称',
avatar text null comment '头像',
email varchar(100) null comment '邮箱',
email varchar(100) not null comment '邮箱',
create_time datetime not null default (utc_timestamp()) comment '创建时间',
update_time datetime not null default (utc_timestamp()) comment '修改时间',
deleted bigint not null default 0,
version int not null default 0,
constraint t_user_info_unique unique (user_id, deleted)
constraint t_user_info_unique_user_id unique (user_id, deleted),
constraint t_user_info_unique_email unique (email, deleted)
) comment '用户资料表';

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="top.fatweb.api.mapper.permission.UserMapper">
<select id="selectOneWithPowerInfoByUsername" resultMap="userWithPowerInfoMap">
<select id="selectOneWithPowerInfoByAccount" resultMap="userWithPowerInfoMap">
select t_user.id as user_id,
t_user.username as user_username,
t_user.password as user_password,
@@ -55,7 +55,7 @@
left join t_func as tf on tp.id = tf.id
left join t_operation as t on tp.id = t.id
where t_user.deleted = 0
and t_user.username = #{username};
and (tui.email = #{account} or t_user.username = #{account});
</select>
<select id="selectPage" resultType="long">