fix: 修复部分因字段加密导致的错误
This commit is contained in:
parent
6435175dc3
commit
43da462560
@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2022-present Charles7c Authors. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
package top.charles7c.continew.admin.common.config.mybatis;
|
package top.charles7c.continew.admin.common.config.mybatis;
|
||||||
|
|
||||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||||
|
@ -21,6 +21,7 @@ import org.apache.ibatis.annotations.Select;
|
|||||||
|
|
||||||
import top.charles7c.continew.admin.common.config.mybatis.DataPermissionMapper;
|
import top.charles7c.continew.admin.common.config.mybatis.DataPermissionMapper;
|
||||||
import top.charles7c.continew.admin.system.model.entity.UserDO;
|
import top.charles7c.continew.admin.system.model.entity.UserDO;
|
||||||
|
import top.charles7c.continew.starter.security.crypto.annotation.FieldEncrypt;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户 Mapper
|
* 用户 Mapper
|
||||||
@ -46,7 +47,7 @@ public interface UserMapper extends DataPermissionMapper<UserDO> {
|
|||||||
* @return 用户信息
|
* @return 用户信息
|
||||||
*/
|
*/
|
||||||
@Select("SELECT * FROM `sys_user` WHERE `phone` = #{phone}")
|
@Select("SELECT * FROM `sys_user` WHERE `phone` = #{phone}")
|
||||||
UserDO selectByPhone(@Param("phone") String phone);
|
UserDO selectByPhone(@FieldEncrypt @Param("phone") String phone);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据邮箱查询
|
* 根据邮箱查询
|
||||||
@ -55,7 +56,7 @@ public interface UserMapper extends DataPermissionMapper<UserDO> {
|
|||||||
* @return 用户信息
|
* @return 用户信息
|
||||||
*/
|
*/
|
||||||
@Select("SELECT * FROM `sys_user` WHERE `email` = #{email}")
|
@Select("SELECT * FROM `sys_user` WHERE `email` = #{email}")
|
||||||
UserDO selectByEmail(@Param("email") String email);
|
UserDO selectByEmail(@FieldEncrypt @Param("email") String email);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据 ID 查询昵称
|
* 根据 ID 查询昵称
|
||||||
|
@ -23,7 +23,6 @@ import top.charles7c.continew.admin.common.enums.DisEnableStatusEnum;
|
|||||||
import top.charles7c.continew.admin.common.enums.GenderEnum;
|
import top.charles7c.continew.admin.common.enums.GenderEnum;
|
||||||
import top.charles7c.continew.starter.extension.crud.model.entity.BaseDO;
|
import top.charles7c.continew.starter.extension.crud.model.entity.BaseDO;
|
||||||
import top.charles7c.continew.starter.security.crypto.annotation.FieldEncrypt;
|
import top.charles7c.continew.starter.security.crypto.annotation.FieldEncrypt;
|
||||||
import top.charles7c.continew.starter.security.crypto.enums.Algorithm;
|
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
@ -65,13 +64,13 @@ public class UserDO extends BaseDO {
|
|||||||
/**
|
/**
|
||||||
* 邮箱
|
* 邮箱
|
||||||
*/
|
*/
|
||||||
@FieldEncrypt(Algorithm.AES)
|
@FieldEncrypt
|
||||||
private String email;
|
private String email;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 手机号码
|
* 手机号码
|
||||||
*/
|
*/
|
||||||
@FieldEncrypt(Algorithm.AES)
|
@FieldEncrypt
|
||||||
private String phone;
|
private String phone;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -45,7 +45,7 @@ public class UserQuery implements Serializable {
|
|||||||
* 用户名
|
* 用户名
|
||||||
*/
|
*/
|
||||||
@Schema(description = "用户名", example = "zhangsan")
|
@Schema(description = "用户名", example = "zhangsan")
|
||||||
@Query(columns = {"username", "nickname", "email", "phone"}, type = QueryType.LIKE)
|
@Query(columns = {"username", "nickname"}, type = QueryType.LIKE)
|
||||||
private String username;
|
private String username;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user