Jelajahi Sumber

调整排序

kphcdr 1 tahun lalu
induk
melakukan
a8b4f478d7

+ 1 - 0
app/Modules/Mini/Controllers/AuthController.php

@@ -53,6 +53,7 @@ class AuthController extends BaseController
             "name" => "string",
             "email" => "string",
             "captcha" => "string",
+            "password" => "string",
         ]);
         if ($captcha = Arr::get($params, 'captcha')) {
             if (!app(CaptchaService::class)->checkCaptcha($params['email'], $captcha)) {

+ 3 - 0
app/Modules/Mini/Services/AuthService.php

@@ -92,6 +92,9 @@ class AuthService extends BaseService
         if ($name = Arr::get($params, "name")) {
             $user->name = $name;
         }
+        if ($name = Arr::get($params, "password")) {
+            $user->password = $user->hashPassword($name);
+        }
 
         $user->save();