diff --git a/beike/Shop/Http/Controllers/Account/AccountController.php b/beike/Shop/Http/Controllers/Account/AccountController.php index 9e2a765c..85180588 100644 --- a/beike/Shop/Http/Controllers/Account/AccountController.php +++ b/beike/Shop/Http/Controllers/Account/AccountController.php @@ -45,10 +45,10 @@ class AccountController extends Controller public function updatePassword(ForgottenRequest $request): array { if (Hash::make($request->get('origin_password')) != current_customer()->getAuthPassword()) { - throw new \Exception("原密码错误"); + throw new \Exception(trans('shop/account.edit.origin_password_fail')); } CustomerRepo::update(current_customer(), ['password' => $request->get('password')]); - return json_success('密码修改成功'); + return json_success(trans('shop/account.edit.password_edit_success')); } } diff --git a/resources/lang/en/shop/account.php b/resources/lang/en/shop/account.php index 76b34d54..2707a82e 100644 --- a/resources/lang/en/shop/account.php +++ b/resources/lang/en/shop/account.php @@ -30,11 +30,13 @@ return [ 'edit' => [ 'index' => 'Edit', - 'modify_avatar' => 'modify avatar', + 'modify_avatar' => 'Modify Avatar', 'suggest' => 'Upload a JPG or PNG image. 300 x 300 is recommended.', - 'name' => 'name', - 'email' => 'email', + 'name' => 'Name', + 'email' => 'Email', 'crop' => 'crop', + 'password_edit_success' => 'Change password successfully!', + 'origin_password_fail' => 'Origin password incorrect!', ], 'wishlist' => [ @@ -115,16 +117,16 @@ return [ 'check' => 'check', 'rma_info' => [ - 'index' => 'after-sales details', + 'index' => 'after-sales details', ], 'rma_form' => [ - 'index' => 'Submit after-sales information', - 'service_type' => 'service type', - 'return_quantity' => 'return quantity', - 'unpacked' => 'unpacked', + 'index' => 'Submit after-sales information', + 'service_type' => 'service type', + 'return_quantity' => 'return quantity', + 'unpacked' => 'unpacked', 'return_reason' => 'reason for return', - 'remark' => 'remark', + 'remark' => 'remark', ] ] ]; diff --git a/resources/lang/zh_cn/shop/account.php b/resources/lang/zh_cn/shop/account.php index 7c695835..4e695f35 100644 --- a/resources/lang/zh_cn/shop/account.php +++ b/resources/lang/zh_cn/shop/account.php @@ -35,6 +35,8 @@ return [ 'name' => '名称', 'email' => '邮箱', 'crop' => '裁剪', + 'password_edit_success' => '密码修改成功', + 'origin_password_fail' => '原密码错误', ], 'wishlist' => [ @@ -115,16 +117,16 @@ return [ 'check' => '查看', 'rma_info' => [ - 'index' => '售后详情', + 'index' => '售后详情', ], 'rma_form' => [ - 'index' => '提交售后信息', - 'service_type' => '服务类型', - 'return_quantity' => '退换数量', - 'unpacked' => '已打开包装', - 'return_reason' => '退换原因', - 'remark' => '备注', + 'index' => '提交售后信息', + 'service_type' => '服务类型', + 'return_quantity' => '退换数量', + 'unpacked' => '已打开包装', + 'return_reason' => '退换原因', + 'remark' => '备注', ] ] ];