diff --git a/beike/Repositories/CustomerRepo.php b/beike/Repositories/CustomerRepo.php index b64aacae..2c83413d 100644 --- a/beike/Repositories/CustomerRepo.php +++ b/beike/Repositories/CustomerRepo.php @@ -12,6 +12,7 @@ namespace Beike\Repositories; use Beike\Models\Customer; +use Illuminate\Support\Facades\Hash; class CustomerRepo { @@ -22,6 +23,7 @@ class CustomerRepo */ public static function create($customerData) { + $customerData['password'] = Hash::make($customerData['password']); return Customer::query()->insertGetId($customerData); } diff --git a/beike/Shop/Services/AccountService.php b/beike/Shop/Services/AccountService.php index 8a81fa41..6a389ed6 100644 --- a/beike/Shop/Services/AccountService.php +++ b/beike/Shop/Services/AccountService.php @@ -25,7 +25,6 @@ class AccountService */ public static function register(array $data): int { - $data['password'] = Hash::make($data['password']); $data['customer_group_id'] = setting('default_customer_group_id', 1); // default_customer_group_id为默认客户组名称 $data['status'] = !setting('approve_customer'); // approve_customer为是否需要审核客户 $data['from'] = $data['from'] ?? 'pc';