str:字符串 beginStr:开始位置 endStr:结束位置;
common.desensitization = function(str,beginStr,endStr){ var len = str.length; var leftStr = str.substring(0,beginStr); var rightStr = str.substring(endStr,len); var str = '' var i = 0; try { for (i = 0; i < endStr-beginStr;i++) { str = str + '*'; } } catch (error) { } str = leftStr + str + rightStr; return str; }