fix: 用户邮箱信息增加脱敏处理

This commit is contained in:
Charles7c 2023-10-25 23:36:45 +08:00
parent f5e8b0943c
commit 5bb35a13d6
6 changed files with 12 additions and 26 deletions

View File

@ -134,6 +134,10 @@ public class UserInfoVO implements Serializable {
@Schema(description = "角色编码集合", example = "[\"test\"]") @Schema(description = "角色编码集合", example = "[\"test\"]")
private Set<String> roles; private Set<String> roles;
public String getEmail() {
return DesensitizedUtil.email(email);
}
public String getPhone() { public String getPhone() {
return DesensitizedUtil.mobilePhone(phone); return DesensitizedUtil.mobilePhone(phone);
} }

View File

@ -96,15 +96,16 @@ public class UserVO extends BaseVO {
@Schema(description = "描述", example = "张三描述信息") @Schema(description = "描述", example = "张三描述信息")
private String description; private String description;
public String getEmail() {
return DesensitizedUtil.email(email);
}
public String getPhone() {
return DesensitizedUtil.mobilePhone(phone);
}
@Override @Override
public Boolean getDisabled() { public Boolean getDisabled() {
return this.getIsSystem() || Objects.equals(this.getId(), LoginHelper.getUserId()); return this.getIsSystem() || Objects.equals(this.getId(), LoginHelper.getUserId());
} }
public String getPhone() {
if (null == phone) {
return null;
}
return DesensitizedUtil.mobilePhone(phone);
}
} }

View File

@ -77,7 +77,6 @@
<script lang="ts" setup> <script lang="ts" setup>
import { getCurrentInstance, ref } from 'vue'; import { getCurrentInstance, ref } from 'vue';
import { useI18n } from 'vue-i18n';
import { import {
UserSocialBindRecord, UserSocialBindRecord,
listSocial, listSocial,
@ -86,7 +85,6 @@
import { socialAuth } from '@/api/auth'; import { socialAuth } from '@/api/auth';
const { proxy } = getCurrentInstance() as any; const { proxy } = getCurrentInstance() as any;
const { t } = useI18n();
const socialBinds = ref<UserSocialBindRecord[]>([]); const socialBinds = ref<UserSocialBindRecord[]>([]);
const giteeSocial = ref<UserSocialBindRecord>(); const giteeSocial = ref<UserSocialBindRecord>();
const githubSocial = ref<UserSocialBindRecord>(); const githubSocial = ref<UserSocialBindRecord>();

View File

@ -148,19 +148,6 @@
'userCenter.securitySettings.updateEmail.form.error.match.newEmail' '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: [ captcha: [
{ {

View File

@ -102,8 +102,6 @@ export default {
'Please enter new email', 'Please enter new email',
'userCenter.securitySettings.updateEmail.form.error.match.newEmail': 'userCenter.securitySettings.updateEmail.form.error.match.newEmail':
'Please enter the correct email', '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': 'userCenter.securitySettings.updateEmail.form.error.required.captcha':
'Please enter email captcha', 'Please enter email captcha',
'userCenter.securitySettings.updateEmail.form.error.required.currentPassword': 'userCenter.securitySettings.updateEmail.form.error.required.currentPassword':

View File

@ -97,8 +97,6 @@ export default {
'请输入新邮箱', '请输入新邮箱',
'userCenter.securitySettings.updateEmail.form.error.match.newEmail': '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.captcha':
'请输入邮箱验证码', '请输入邮箱验证码',
'userCenter.securitySettings.updateEmail.form.error.required.currentPassword': 'userCenter.securitySettings.updateEmail.form.error.required.currentPassword':