diff --git a/beike/Shop/Http/Controllers/Account/LoginController.php b/beike/Shop/Http/Controllers/Account/LoginController.php index e00f65f5..71aaff2c 100644 --- a/beike/Shop/Http/Controllers/Account/LoginController.php +++ b/beike/Shop/Http/Controllers/Account/LoginController.php @@ -29,14 +29,14 @@ class LoginController extends Controller public function store(LoginRequest $request) { if (!auth(Customer::AUTH_GUARD)->attempt($request->only('email', 'password'))) { - throw new \Exception("账号密码错误!"); + throw new \Exception(trans('shop/login.email_or_password_error')); } $customer = current_customer(); if ($customer && $customer->status != 1) { Auth::guard(Customer::AUTH_GUARD)->logout(); - throw new \Exception("用户已被禁用!"); + throw new \Exception(trans('shop/login.customer_inactive')); } - return json_success("登录成功!"); + return json_success(trans('shop/login.login_successfully')); } } diff --git a/resources/lang/en/shop/login.php b/resources/lang/en/shop/login.php index adbde51c..9fc905c0 100644 --- a/resources/lang/en/shop/login.php +++ b/resources/lang/en/shop/login.php @@ -12,6 +12,7 @@ return [ 'index' => 'User login and registration', + 'login_and_sign' => 'Login/Sign In', 'home' => 'home', 'library' => 'library', 'login' => 'login', @@ -21,7 +22,6 @@ return [ 'email_address' => 'email address', 'password' => 'password', 'forget_password' => 'forget password', - 'login' => 'login', 'new' => 'new account', 'not_already' => 'Not yet our registered customer?', 'confirm_password' => 'confirm password', @@ -32,4 +32,7 @@ return [ 'password_err' => 'The passwords entered twice do not match!', 'email_err' => 'Please enter a valid email address!', 'check_form' => 'Please check that the form is filled out correctly', + 'email_or_password_error' => 'Email or Password is incorrect!', + 'customer_inactive' => 'The customer is inactive!', + 'login_successfully' => 'Login successfully!', ]; diff --git a/resources/lang/zh_cn/shop/login.php b/resources/lang/zh_cn/shop/login.php index 4412163d..3c9b3a93 100644 --- a/resources/lang/zh_cn/shop/login.php +++ b/resources/lang/zh_cn/shop/login.php @@ -12,6 +12,7 @@ return [ 'index' => '用户登录与注册', + 'login_and_sign' => '登录/注册', 'home' => '首页', 'library' => '个人中心', 'login' => '登录', @@ -21,7 +22,6 @@ return [ 'email_address' => '邮件地址', 'password' => '密码', 'forget_password' => '忘记密码', - 'login' => '登录', 'new' => '新账号', 'not_already' => '还不是我们的注册客户?', 'confirm_password' => '确认密码', @@ -32,4 +32,7 @@ return [ 'password_err' => '两次输入密码不一致!', 'email_err' => '请输入正确邮箱地址!', 'check_form' => '请检查表单是否填写正确', + 'email_or_password_error' => '邮件或密码错误!', + 'customer_inactive' => '用户已被禁用', + 'login_successfully' => '登录成功', ]; diff --git a/themes/default/layout/header.blade.php b/themes/default/layout/header.blade.php index 4a60c2b2..f7a8be79 100644 --- a/themes/default/layout/header.blade.php +++ b/themes/default/layout/header.blade.php @@ -127,7 +127,7 @@ 退出登录 @else
  • 登录/注册
  • + class="bi bi-box-arrow-right me-1">{{ __('shop/login.login_and_sign') }} @endauth