diff --git a/application/admin/view/index/login.html b/application/admin/view/index/login.html
index b2b0322f..b02aa6fe 100644
--- a/application/admin/view/index/login.html
+++ b/application/admin/view/index/login.html
@@ -74,6 +74,7 @@
#login-form .form-control {
font-size: 13px;
+ height: 40px;
}
@@ -118,7 +119,7 @@
-
+
{/if}
diff --git a/application/api/controller/Ems.php b/application/api/controller/Ems.php
index 4c2e8a4d..dc5598d3 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()
{
@@ -49,13 +49,13 @@ class Ems extends Api
}
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'));
}
$ipSendTotal = \app\common\model\Ems::where(['ip' => $this->request->ip()])->whereTime('createtime', '-1 hours')->count();
@@ -67,20 +67,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::send($email, null, $event);
if ($ret) {
- $this->success(__('发送成功'));
+ $this->success(__('Send successful'));
} else {
- $this->error(__('发送失败'));
+ $this->error(__('Send failed'));
}
}
@@ -89,7 +89,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()
@@ -114,20 +114,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
diff --git a/application/common.php b/application/common.php
index 523384a1..e6483707 100755
--- a/application/common.php
+++ b/application/common.php
@@ -86,6 +86,7 @@ if (!function_exists('cdnurl')) {
*/
function cdnurl($url, $domain = false)
{
+ if(!$url) return '';
$regex = "/^((?:[a-z]+:)?\/\/|data:image\/)(.*)/i";
$cdnurl = \think\Config::get('upload.cdnurl');
if (is_bool($domain) || stripos($cdnurl, '/') === 0) {
diff --git a/application/database.php b/application/database.php
index 7b9f8f23..64ad5559 100755
--- a/application/database.php
+++ b/application/database.php
@@ -18,11 +18,11 @@ return [
// 服务器地址
'hostname' => Env::get('database.hostname', '127.0.0.1'),
// 数据库名
- 'database' => Env::get('database.database', 'fastadmin'),
+ 'database' => Env::get('database.database', 'fastadmin_fork'),
// 用户名
'username' => Env::get('database.username', 'root'),
// 密码
- 'password' => Env::get('database.password', ''),
+ 'password' => Env::get('database.password', 'root'),
// 端口
'hostport' => Env::get('database.hostport', ''),
// 连接dsn
@@ -53,4 +53,7 @@ return [
'datetime_format' => false,
// 是否需要进行SQL性能分析
'sql_explain' => false,
+
+ // 是否需要断线重连
+ 'break_reconnect' => false,
];