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
{
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'));
}
}

View File

@ -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',
]
]
];

View File

@ -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' => '备注',
]
]
];