fix(user-select-modal): 专区白名单手机号改为不脱敏显示

- UserSelectModal.vue 中候选行手机号由 u.mobile 改为 u.phone || u.mobile || '-'
- 表格列手机号由 dataIndex: 'mobile' 改为 dataIndex: 'phone'
- 表格列 customRender 实现回退到 record.mobile 显示真实号码
- 无需后端改动,只需重新构建 admin 前端进行部署
This commit is contained in:
2026-08-17 03:26:07 +08:00
parent 47fb8d1bd0
commit 3c4e30c227
2 changed files with 8 additions and 2 deletions
+6
View File
@@ -135,3 +135,9 @@
- 改动:`src/views/special/zone/components/UserSelectModal.vue` 外层容器由 `<a-modal>` 改为 `<a-drawer placement="right" :width="820">`,内部搜索/候选/已添加列表逻辑原样保留,props/emits(`visible`/`sectionId`/`update:visible`) 不变。 - 改动:`src/views/special/zone/components/UserSelectModal.vue` 外层容器由 `<a-modal>` 改为 `<a-drawer placement="right" :width="820">`,内部搜索/候选/已添加列表逻辑原样保留,props/emits(`visible`/`sectionId`/`update:visible`) 不变。
- `index.vue` 中 `<UserSelectModal v-model:visible="showUser" :sectionId="currentSectionId" />` 调用方式无需改动(与商品抽屉同为右侧弹出)。 - `index.vue` 中 `<UserSelectModal v-model:visible="showUser" :sectionId="currentSectionId" />` 调用方式无需改动(与商品抽屉同为右侧弹出)。
- 部署:重新构建 admin 前端(npm run dev 热更新或 build)即可,无需后端改动。 - 部署:重新构建 admin 前端(npm run dev 热更新或 build)即可,无需后端改动。
## 专区白名单手机号改为不脱敏
- 需求:专区「白名单」抽屉里手机号不要脱敏显示。
- 根因:系统 User 实体 `mobile` 是 `@TableField(exist=false)` 的脱敏字段(`getMobile()` 返回 `DesensitizedUtil.mobilePhone(phone)`);`phone` 才是 DB 真实号码,无 `@JsonIgnore`、无全局脱敏 → 接口同时返回 `phone`(真实) 与 `mobile`(脱敏)。
- 改动:`UserSelectModal.vue` 两处展示由 `u.mobile` 改为 `u.phone`(候选行 `u.phone || u.mobile || '-'`;表格列 `dataIndex:'phone'` + `customRender` 回退 `record.mobile`),后端无需改动。
- 部署:重新构建 admin 前端即可。
@@ -36,7 +36,7 @@
style="display: flex; align-items: center; padding: 4px 0; gap: 8px; border-bottom: 1px solid #f0f0f0;" style="display: flex; align-items: center; padding: 4px 0; gap: 8px; border-bottom: 1px solid #f0f0f0;"
> >
<span style="flex: 1; font-size: 13px;">{{ u.realName || '-' }}</span> <span style="flex: 1; font-size: 13px;">{{ u.realName || '-' }}</span>
<span style="color: #999; font-size: 12px;">{{ u.mobile || '-' }}</span> <span style="color: #999; font-size: 12px;">{{ u.phone || u.mobile || '-' }}</span>
<span style="color: #999; font-size: 12px;">{{ u.nickname || '' }}</span> <span style="color: #999; font-size: 12px;">{{ u.nickname || '' }}</span>
<a-button type="link" size="small" style="padding: 0;" @click="addOne(u)">+ 添加</a-button> <a-button type="link" size="small" style="padding: 0;" @click="addOne(u)">+ 添加</a-button>
</div> </div>
@@ -99,7 +99,7 @@
const columns = [ const columns = [
{ title: 'ID', dataIndex: 'userId', key: 'userId', align: 'center', width: 80 }, { title: 'ID', dataIndex: 'userId', key: 'userId', align: 'center', width: 80 },
{ title: '姓名', dataIndex: 'realName', key: 'realName', align: 'center' }, { title: '姓名', dataIndex: 'realName', key: 'realName', align: 'center' },
{ title: '手机号码', dataIndex: 'mobile', key: 'mobile', align: 'center' }, { title: '手机号码', dataIndex: 'phone', key: 'phone', align: 'center', customRender: ({ text, record }: any) => text || record.mobile || '-' },
{ title: '昵称', dataIndex: 'nickname', key: 'nickname', align: 'center' }, { title: '昵称', dataIndex: 'nickname', key: 'nickname', align: 'center' },
{ title: '所属部门', dataIndex: 'organizationName', key: 'organizationName', align: 'center' }, { title: '所属部门', dataIndex: 'organizationName', key: 'organizationName', align: 'center' },
{ title: '操作', key: 'action', align: 'center', width: 90 } { title: '操作', key: 'action', align: 'center', width: 90 }