<!--自定义FreeMark函数,data--数据字符串,beginLen--数据明文保留长度(头),endLen--数据明文保留长度(尾),中间用*代替明文-->
<#function desensitizationData data beginLen endLen>
<#local strLength = data?length>
<#local hideLen = strLength - beginLen -endLen>
<#local hideStr="">
<#list 1..13 as x>
<#if x==hideLen>
<#break>
</#if>
<#local hideStr=hideStr+"*">
</#list>
<#local beginStr = data?substring(0,beginLen)>
<#local endStr = data?substring(strLength-endLen)>
<#return beginStr + hideStr + endStr>
</#function>
调用函数
<#if user.card?? && user.card!="">${desensitizationData(user.card!,4,4)}</#if>