master
elf 3 years ago
parent 873695517f
commit 448b10a2b3

@ -3090,4 +3090,20 @@ function getRandomPassword($length, $special = false){
$password .= $chars[mt_rand(0, $charsLen)]; $password .= $chars[mt_rand(0, $charsLen)];
} }
return $password; return $password;
}
function encodeStr($str)
{
# 判断字符串长度
$length = strlen($str);
if ($length == 1) {
# 长度为 1 前后拼接 * 号
$newStr = $str.'*'.rand(1,6);
}else{
# 长度超过1随机插入 * 号
$newStr = substr_replace($str,str_repeat('*',$length/2),ceil($length/2),$length).mb_substr($str,$length-2,$length,"utf-8");
// str_repeat('*',$length/2) 星号重复字符长度的一半长度
// ceil($length/2) 算出从第几个字符开始
}
return $newStr;
} }

@ -221,10 +221,10 @@
</td> </td>
<td>{$data.base_game_name}</td> <td>{$data.base_game_name}</td>
<td>{$data.server_name}</td> <td>{$data.server_name}</td>
<td>{$data.user_account}</td> <td><?=encodeStr($data['user_account'])?></td>
<td>{$data.role_id}</td> <td>{$data.role_id}</td>
<td>{$data.role_name}</td> <td>{$data.role_name}</td>
<td>{$data.promote_account}</td> <td><?=encodeStr($data['promote_account'])?></td>
<?php if($awardType == 'A'):?> <?php if($awardType == 'A'):?>
<td>{$data.pay_amount}</td> <td>{$data.pay_amount}</td>
<?php elseif($awardType == 'B'):?> <?php elseif($awardType == 'B'):?>
@ -279,7 +279,7 @@
</td> </td>
<td>{$data.review_time}</td> <td>{$data.review_time}</td>
<td>{$data.reviewer_username}</td> <td><?=encodeStr($data['reviewer_username'])?></td>
</tr> </tr>
</volist> </volist>
</empty> </empty>

Loading…
Cancel
Save