wesmiler 2 years ago
parent
commit
3c2d2fa492
2 changed files with 2 additions and 2 deletions
  1. 1 1
      app/Helpers/common.php
  2. 1 1
      app/Services/Api/MemberService.php

+ 1 - 1
app/Helpers/common.php

@@ -657,7 +657,7 @@ if (!function_exists('get_random_code')) {
      */
     function get_random_code($length = 8, $prefix = '', $ext = '')
     {
-        $length = $length < 9 ? 9 : $length;
+        $length = $length < 8 ? 8 : $length;
         $code = strtoupper(md5(uniqid(mt_rand(), true) . $ext . microtime()));
         $start = rand(1, strlen($code) - $length);
         return $prefix . mb_substr($code, $start, $length);

+ 1 - 1
app/Services/Api/MemberService.php

@@ -525,7 +525,7 @@ class MemberService extends BaseService
             'nickname' => $nickname ? $nickname : get_username($id,'用户'),
             'username' => $email,
             'password' => get_password('xl123456'),
-            'code' => strtoupper(get_random_code(8, 'XL', "{$id}")),
+            'code' => strtoupper(get_random_code(9, 'X', "{$id}")),
             'email' => $email,
             'mobile' => $mobile,
             'recharge_trc_url' => UdunpayService::make()->createAddress(195),