fixed password

This commit is contained in:
Edward Yang 2022-08-22 18:05:11 +08:00
parent f394b20d31
commit dffc6e6799
3 changed files with 22 additions and 18 deletions

View File

@ -45,10 +45,10 @@ class AccountController extends Controller
public function updatePassword(ForgottenRequest $request): array public function updatePassword(ForgottenRequest $request): array
{ {
if (Hash::make($request->get('origin_password')) != current_customer()->getAuthPassword()) { 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')]); CustomerRepo::update(current_customer(), ['password' => $request->get('password')]);
return json_success('密码修改成功'); return json_success(trans('shop/account.edit.password_edit_success'));
} }
} }

View File

@ -30,11 +30,13 @@ return [
'edit' => [ 'edit' => [
'index' => 'Edit', 'index' => 'Edit',
'modify_avatar' => 'modify avatar', 'modify_avatar' => 'Modify Avatar',
'suggest' => 'Upload a JPG or PNG image. 300 x 300 is recommended.', 'suggest' => 'Upload a JPG or PNG image. 300 x 300 is recommended.',
'name' => 'name', 'name' => 'Name',
'email' => 'email', 'email' => 'Email',
'crop' => 'crop', 'crop' => 'crop',
'password_edit_success' => 'Change password successfully!',
'origin_password_fail' => 'Origin password incorrect!',
], ],
'wishlist' => [ 'wishlist' => [
@ -115,16 +117,16 @@ return [
'check' => 'check', 'check' => 'check',
'rma_info' => [ 'rma_info' => [
'index' => 'after-sales details', 'index' => 'after-sales details',
], ],
'rma_form' => [ 'rma_form' => [
'index' => 'Submit after-sales information', 'index' => 'Submit after-sales information',
'service_type' => 'service type', 'service_type' => 'service type',
'return_quantity' => 'return quantity', 'return_quantity' => 'return quantity',
'unpacked' => 'unpacked', 'unpacked' => 'unpacked',
'return_reason' => 'reason for return', 'return_reason' => 'reason for return',
'remark' => 'remark', 'remark' => 'remark',
] ]
] ]
]; ];

View File

@ -35,6 +35,8 @@ return [
'name' => '名称', 'name' => '名称',
'email' => '邮箱', 'email' => '邮箱',
'crop' => '裁剪', 'crop' => '裁剪',
'password_edit_success' => '密码修改成功',
'origin_password_fail' => '原密码错误',
], ],
'wishlist' => [ 'wishlist' => [
@ -115,16 +117,16 @@ return [
'check' => '查看', 'check' => '查看',
'rma_info' => [ 'rma_info' => [
'index' => '售后详情', 'index' => '售后详情',
], ],
'rma_form' => [ 'rma_form' => [
'index' => '提交售后信息', 'index' => '提交售后信息',
'service_type' => '服务类型', 'service_type' => '服务类型',
'return_quantity' => '退换数量', 'return_quantity' => '退换数量',
'unpacked' => '已打开包装', 'unpacked' => '已打开包装',
'return_reason' => '退换原因', 'return_reason' => '退换原因',
'remark' => '备注', 'remark' => '备注',
] ]
] ]
]; ];