Skip to content

Commit

Permalink
fix: 用户邮箱信息增加脱敏处理
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles7c committed Oct 25, 2023
1 parent f5e8b09 commit 5bb35a1
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ public class UserInfoVO implements Serializable {
@Schema(description = "角色编码集合", example = "[\"test\"]")
private Set<String> roles;

public String getEmail() {
return DesensitizedUtil.email(email);
}

public String getPhone() {
return DesensitizedUtil.mobilePhone(phone);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,16 @@ public class UserVO extends BaseVO {
@Schema(description = "描述", example = "张三描述信息")
private String description;

@Override
public Boolean getDisabled() {
return this.getIsSystem() || Objects.equals(this.getId(), LoginHelper.getUserId());
public String getEmail() {
return DesensitizedUtil.email(email);
}

public String getPhone() {
if (null == phone) {
return null;
}
return DesensitizedUtil.mobilePhone(phone);
}

@Override
public Boolean getDisabled() {
return this.getIsSystem() || Objects.equals(this.getId(), LoginHelper.getUserId());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@

<script lang="ts" setup>
import { getCurrentInstance, ref } from 'vue';
import { useI18n } from 'vue-i18n';
import {
UserSocialBindRecord,
listSocial,
Expand All @@ -86,7 +85,6 @@
import { socialAuth } from '@/api/auth';
const { proxy } = getCurrentInstance() as any;
const { t } = useI18n();
const socialBinds = ref<UserSocialBindRecord[]>([]);
const giteeSocial = ref<UserSocialBindRecord>();
const githubSocial = ref<UserSocialBindRecord>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,19 +148,6 @@
'userCenter.securitySettings.updateEmail.form.error.match.newEmail'
),
},
{
validator: (value, callback) => {
if (value === userStore.email) {
callback(
t(
'userCenter.securitySettings.updateEmail.form.error.validator.newEmail'
)
);
} else {
callback();
}
},
},
],
captcha: [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,6 @@ export default {
'Please enter new email',
'userCenter.securitySettings.updateEmail.form.error.match.newEmail':
'Please enter the correct email',
'userCenter.securitySettings.updateEmail.form.error.validator.newEmail':
'New email cannot be the same as the old email',
'userCenter.securitySettings.updateEmail.form.error.required.captcha':
'Please enter email captcha',
'userCenter.securitySettings.updateEmail.form.error.required.currentPassword':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@ export default {
'请输入新邮箱',
'userCenter.securitySettings.updateEmail.form.error.match.newEmail':
'请输入正确的邮箱',
'userCenter.securitySettings.updateEmail.form.error.validator.newEmail':
'新邮箱不能与当前邮箱相同',
'userCenter.securitySettings.updateEmail.form.error.required.captcha':
'请输入邮箱验证码',
'userCenter.securitySettings.updateEmail.form.error.required.currentPassword':
Expand Down

0 comments on commit 5bb35a1

Please sign in to comment.