diff --git a/Application/Common/Common/extend.php b/Application/Common/Common/extend.php index 2f3c05a84..df438801d 100644 --- a/Application/Common/Common/extend.php +++ b/Application/Common/Common/extend.php @@ -3090,4 +3090,20 @@ function getRandomPassword($length, $special = false){ $password .= $chars[mt_rand(0, $charsLen)]; } 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; } \ No newline at end of file diff --git a/Application/Home/View/default/GameRebate/records.html b/Application/Home/View/default/GameRebate/records.html index dc5aed4f9..e22631618 100644 --- a/Application/Home/View/default/GameRebate/records.html +++ b/Application/Home/View/default/GameRebate/records.html @@ -221,10 +221,10 @@