feat(ip白名单时密钥脱敏,并隐藏超长显示):

This commit is contained in:
fuhao 2024-09-05 19:01:38 +08:00
parent a45eb8ad3b
commit 142e680e65
No known key found for this signature in database
1 changed files with 9 additions and 3 deletions

View File

@ -56,8 +56,8 @@
<el-table-column label="唯一标识" align="center" prop="id" />
<el-table-column label="名称" align="center" prop="name" />
<el-table-column label="IP地址" align="center" prop="ip" />
<el-table-column label="安全密钥" align="center" prop="securityKey" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="安全密钥" align="center" prop="securityKey" :formatter="(row) => formatSecurityKey(row.securityKey)" show-overflow-tooltip />
<el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
@ -260,7 +260,13 @@ export default {
this.download('board/whiteIp/export', {
...this.queryParams
}, `whiteIp_${new Date().getTime()}.xlsx`)
}
},
formatSecurityKey(securityKey) {
if (securityKey && securityKey.length > 6) {
return securityKey.substring(0, 6) + '*'.repeat(securityKey.length - 6);
}
return securityKey;
},
}
};
</script>