Ken 2 weeks ago
parent
commit
70a8c7cd94
1 changed files with 6 additions and 0 deletions
  1. 6 0
      app/Services/SecretService.php

+ 6 - 0
app/Services/SecretService.php

@@ -60,6 +60,12 @@ class SecretService
     private static function showSecretKey($chatId, $password, $messageId): array
     {
         $user = User::where('member_id', $chatId)->first();
+        if ($user->secret_pass == '') {
+            $user->secret_pass = $password;
+            $user->save();
+        }
+
+
         if ($user->secret_pass === $password) {
             $text = "秘钥:{$user->secret_key}\n\n";
             $text .= "请保管好你的秘钥";