diff --git a/application/admin/view/index/login.html b/application/admin/view/index/login.html index 68d4a5f8..b5b944d8 100644 --- a/application/admin/view/index/login.html +++ b/application/admin/view/index/login.html @@ -73,6 +73,7 @@ #login-form .form-control { font-size: 13px; + height: 40px; } @@ -117,7 +118,7 @@
- + {/if} diff --git a/application/api/controller/Ems.php b/application/api/controller/Ems.php index 1a37c1b5..9ee6a1ac 100644 --- a/application/api/controller/Ems.php +++ b/application/api/controller/Ems.php @@ -25,7 +25,7 @@ class Ems extends Api * * @ApiMethod (POST) * @param string $email 邮箱 - * @param string $event 事件名称 + * @param string $event 事件名称,register,changeemail,resetpwd */ public function send() { @@ -37,32 +37,32 @@ class Ems extends Api //发送前验证码 if (config('fastadmin.user_api_captcha')) { if (!\think\Validate::is($captcha, 'captcha')) { - $this->error("验证码不正确"); + $this->error(__('Verification code is incorrect')); } } $last = Emslib::get($email, $event); if ($last && time() - $last['createtime'] < 60) { - $this->error(__('发送频繁')); + $this->error(__('Send frequently')); } if ($event) { $userinfo = User::getByEmail($email); if ($event == 'register' && $userinfo) { //已被注册 - $this->error(__('已被注册')); + $this->error(__('Already registered')); } elseif (in_array($event, ['changeemail']) && $userinfo) { //被占用 - $this->error(__('已被占用')); + $this->error(__('Already occupied')); } elseif (in_array($event, ['changepwd', 'resetpwd']) && !$userinfo) { //未注册 - $this->error(__('未注册')); + $this->error(__('Not registered')); } } $ret = Emslib::send($email, null, $event); if ($ret) { - $this->success(__('发送成功')); + $this->success(__('Send successful')); } else { - $this->error(__('发送失败')); + $this->error(__('Send failed')); } } @@ -71,7 +71,7 @@ class Ems extends Api * * @ApiMethod (POST) * @param string $email 邮箱 - * @param string $event 事件名称 + * @param string $event 事件名称,register,changeemail,resetpwd * @param string $captcha 验证码 */ public function check() @@ -85,20 +85,20 @@ class Ems extends Api $userinfo = User::getByEmail($email); if ($event == 'register' && $userinfo) { //已被注册 - $this->error(__('已被注册')); + $this->error(__('Already registered')); } elseif (in_array($event, ['changeemail']) && $userinfo) { //被占用 - $this->error(__('已被占用')); + $this->error(__('Already occupied')); } elseif (in_array($event, ['changepwd', 'resetpwd']) && !$userinfo) { //未注册 - $this->error(__('未注册')); + $this->error(__('Not registered')); } } $ret = Emslib::check($email, $captcha, $event); if ($ret) { - $this->success(__('成功')); + $this->success(__('Successful')); } else { - $this->error(__('验证码不正确')); + $this->error(__('Verification code is incorrect')); } } } diff --git a/application/api/controller/Sms.php b/application/api/controller/Sms.php index df335fb4..919e95ed 100644 --- a/application/api/controller/Sms.php +++ b/application/api/controller/Sms.php @@ -20,7 +20,7 @@ class Sms extends Api * * @ApiMethod (POST) * @param string $mobile 手机号 - * @param string $event 事件名称 + * @param string $event 事件名称,register,mobilelogin,changemobile,resetpwd */ public function send() { @@ -32,31 +32,31 @@ class Sms extends Api //发送前验证码 if (config('fastadmin.user_api_captcha')) { if (!\think\Validate::is($captcha, 'captcha')) { - $this->error("验证码不正确"); + $this->error(__('Verification code is incorrect')); } } if (!$mobile || !\think\Validate::regex($mobile, "^1\d{10}$")) { - $this->error(__('手机号不正确')); + $this->error(__('Mobile is incorrect')); } $last = Smslib::get($mobile, $event); if ($last && time() - $last['createtime'] < 60) { - $this->error(__('发送频繁')); + $this->error(__('Send frequently')); } $ipSendTotal = \app\common\model\Sms::where(['ip' => $this->request->ip()])->whereTime('createtime', '-1 hours')->count(); if ($ipSendTotal >= 5) { - $this->error(__('发送频繁')); + $this->error(__('Send frequently')); } if ($event) { $userinfo = User::getByMobile($mobile); if ($event == 'register' && $userinfo) { //已被注册 - $this->error(__('已被注册')); + $this->error(__('Already registered')); } elseif (in_array($event, ['changemobile']) && $userinfo) { //被占用 - $this->error(__('已被占用')); + $this->error(__('Already occupied')); } elseif (in_array($event, ['changepwd', 'resetpwd']) && !$userinfo) { //未注册 - $this->error(__('未注册')); + $this->error(__('Not registered')); } } if (!Hook::get('sms_send')) { @@ -64,9 +64,9 @@ class Sms extends Api } $ret = Smslib::send($mobile, null, $event); if ($ret) { - $this->success(__('发送成功')); + $this->success(__('Send successful')); } else { - $this->error(__('发送失败,请检查短信配置是否正确')); + $this->error(__('Send failed, please check the SMS config is correct')); } } @@ -75,7 +75,7 @@ class Sms extends Api * * @ApiMethod (POST) * @param string $mobile 手机号 - * @param string $event 事件名称 + * @param string $event 事件名称,register,mobilelogin,changemobile,resetpwd * @param string $captcha 验证码 */ public function check() @@ -86,26 +86,26 @@ class Sms extends Api $captcha = $this->request->post("captcha"); if (!$mobile || !\think\Validate::regex($mobile, "^1\d{10}$")) { - $this->error(__('手机号不正确')); + $this->error(__('Mobile is incorrect')); } if ($event) { $userinfo = User::getByMobile($mobile); if ($event == 'register' && $userinfo) { //已被注册 - $this->error(__('已被注册')); + $this->error(__('Already registered')); } elseif (in_array($event, ['changemobile']) && $userinfo) { //被占用 - $this->error(__('已被占用')); + $this->error(__('Already occupied')); } elseif (in_array($event, ['changepwd', 'resetpwd']) && !$userinfo) { //未注册 - $this->error(__('未注册')); + $this->error(__('Not registered')); } } $ret = Smslib::check($mobile, $captcha, $event); if ($ret) { - $this->success(__('成功')); + $this->success(__('Successful')); } else { - $this->error(__('验证码不正确')); + $this->error(__('Verification code is incorrect')); } } } diff --git a/application/api/controller/Validate.php b/application/api/controller/Validate.php index adb36d0f..c3d6a1d9 100644 --- a/application/api/controller/Validate.php +++ b/application/api/controller/Validate.php @@ -32,7 +32,7 @@ class Validate extends Api $id = (int)$this->request->post('id'); $count = User::where('email', '=', $email)->where('id', '<>', $id)->count(); if ($count > 0) { - $this->error(__('邮箱已经被占用')); + $this->error(__('Email already occupied')); } $this->success(); } @@ -50,7 +50,7 @@ class Validate extends Api $id = (int)$this->request->post('id'); $count = User::where('username', '=', $username)->where('id', '<>', $id)->count(); if ($count > 0) { - $this->error(__('用户名已经被占用')); + $this->error(__('Username already occupied')); } $this->success(); } @@ -68,7 +68,7 @@ class Validate extends Api $id = (int)$this->request->post('id'); $count = User::where('nickname', '=', $nickname)->where('id', '<>', $id)->count(); if ($count > 0) { - $this->error(__('昵称已经被占用')); + $this->error(__('Nickname already occupied')); } $this->success(); } @@ -86,7 +86,7 @@ class Validate extends Api $id = (int)$this->request->post('id'); $count = User::where('mobile', '=', $mobile)->where('id', '<>', $id)->count(); if ($count > 0) { - $this->error(__('该手机号已经占用')); + $this->error(__('Mobile already occupied')); } $this->success(); } @@ -102,7 +102,7 @@ class Validate extends Api $mobile = $this->request->post('mobile'); $count = User::where('mobile', '=', $mobile)->count(); if (!$count) { - $this->error(__('手机号不存在')); + $this->error(__('Mobile not exists')); } $this->success(); } @@ -118,7 +118,7 @@ class Validate extends Api $email = $this->request->post('email'); $count = User::where('email', '=', $email)->count(); if (!$count) { - $this->error(__('邮箱不存在')); + $this->error(__('Email not exists')); } $this->success(); } @@ -137,7 +137,7 @@ class Validate extends Api $captcha = $this->request->post('captcha'); $event = $this->request->post('event'); if (!\app\common\library\Sms::check($mobile, $captcha, $event)) { - $this->error(__('验证码不正确')); + $this->error(__('Verification code is incorrect')); } $this->success(); } @@ -156,7 +156,7 @@ class Validate extends Api $captcha = $this->request->post('captcha'); $event = $this->request->post('event'); if (!\app\common\library\Ems::check($email, $captcha, $event)) { - $this->error(__('验证码不正确')); + $this->error(__('Verification code is incorrect')); } $this->success(); } diff --git a/application/api/lang/zh-cn/ems.php b/application/api/lang/zh-cn/ems.php new file mode 100644 index 00000000..951f9271 --- /dev/null +++ b/application/api/lang/zh-cn/ems.php @@ -0,0 +1,11 @@ + '验证码不正确', + 'Send frequently' => '发送频繁', + 'Already registered' => '已被注册', + 'Already occupied' => '已被占用', + 'Not registered' => '未注册', + 'Send successful' => '发送成功', + 'Send failed' => '发送失败', + 'Successful' => '成功', +]; \ No newline at end of file diff --git a/application/api/lang/zh-cn/sms.php b/application/api/lang/zh-cn/sms.php new file mode 100644 index 00000000..5a5df1cd --- /dev/null +++ b/application/api/lang/zh-cn/sms.php @@ -0,0 +1,12 @@ + '验证码不正确', + 'Mobile is incorrect' => '手机号不正确', + 'Send frequently' => '发送频繁', + 'Already registered' => '已被注册', + 'Already occupied' => '已被占用', + 'Not registered' => '未注册', + 'Send successful' => '发送成功', + 'Send failed, please check the SMS config is correct' => '发送失败,请检查短信配置是否正确', + 'Successful' => '成功', +]; \ No newline at end of file diff --git a/application/api/lang/zh-cn/validate.php b/application/api/lang/zh-cn/validate.php new file mode 100644 index 00000000..dd6878f1 --- /dev/null +++ b/application/api/lang/zh-cn/validate.php @@ -0,0 +1,10 @@ + '邮箱已经被占用', + 'Username already occupied' => '用户名已经被占用', + 'Nickname already occupied' => '昵称已经被占用', + 'Mobile already occupied' => '该手机号已经占用', + 'Mobile not exists' => '手机号不存在', + 'Email not exists' => '邮箱不存在', + 'Verification code is incorrect' => '验证码不正确', +]; \ No newline at end of file