From dcd0a80bd4a95c3d42b7eccfc00ef40a45eb1bbb Mon Sep 17 00:00:00 2001 From: Chrisleung Date: Thu, 8 Feb 2018 14:18:47 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E4=BF=AE=E5=A4=8Dapi=E6=BC=94=E7=A4=BA?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E8=BF=94=E5=9B=9E=E4=BF=A1=E6=81=AF=E6=96=87?= =?UTF-8?q?=E5=AD=97=E9=94=99=E8=AF=AF=202.=20=E4=BF=AE=E5=A4=8D=E4=BC=9A?= =?UTF-8?q?=E5=91=98=E6=A8=A1=E5=9D=97,=E4=BF=AE=E6=94=B9,=E6=BF=80?= =?UTF-8?q?=E6=B4=BB=E9=82=AE=E7=AE=B1,=E6=89=8B=E6=9C=BA=E5=8F=B7?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/command/Install/fastadmin.sql | 3 ++- application/api/controller/User.php | 18 +++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/application/admin/command/Install/fastadmin.sql b/application/admin/command/Install/fastadmin.sql index 2c54a388..b2d8c410 100755 --- a/application/admin/command/Install/fastadmin.sql +++ b/application/admin/command/Install/fastadmin.sql @@ -424,6 +424,7 @@ CREATE TABLE `fa_user` ( `updatetime` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间', `token` varchar(50) NOT NULL DEFAULT '' COMMENT 'Token', `status` varchar(30) NOT NULL DEFAULT '' COMMENT '状态', + `verification` varchar(255) NOT NULL DEFAULT '' COMMENT '验证', PRIMARY KEY (`id`), KEY `username` (`username`), KEY `email` (`email`), @@ -431,7 +432,7 @@ CREATE TABLE `fa_user` ( ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='会员表'; BEGIN; -INSERT INTO `fa_user` VALUES (1, 1, 'admin', 'admin', 'c13f62012fd6a8fdf06b3452a94430e5', 'rpR6Bv', 'admin@163.com', '13888888888', '/assets/img/avatar.png', 0, 0, '2017-04-15', '', 0, 1, 1, 1516170492, 1516171614, '127.0.0.1', 0, '127.0.0.1', 1491461418, 0, 1516171614, '', 'normal'); +INSERT INTO `fa_user` VALUES (1, 1, 'admin', 'admin', 'c13f62012fd6a8fdf06b3452a94430e5', 'rpR6Bv', 'admin@163.com', '13888888888', '/assets/img/avatar.png', 0, 0, '2017-04-15', '', 0, 1, 1, 1516170492, 1516171614, '127.0.0.1', 0, '127.0.0.1', 1491461418, 0, 1516171614, '', 'normal',''); COMMIT; DROP TABLE IF EXISTS `fa_user_group`; diff --git a/application/api/controller/User.php b/application/api/controller/User.php index b3a63451..c2ec2652 100644 --- a/application/api/controller/User.php +++ b/application/api/controller/User.php @@ -72,11 +72,11 @@ class User extends Api } if (!Validate::regex($mobile, "^1\d{10}$")) { - $this->error(__('Mobile incorrect')); + $this->error(__('Mobile is incorrect')); } if (!Sms::check($mobile, $captcha, 'mobilelogin')) { - $this->error(__('Captcha invalid')); + $this->error(__('Captcha is incorrect')); } $user = \app\common\model\User::getByMobile($mobile); if ($user) @@ -120,11 +120,11 @@ class User extends Api } if ($email && !Validate::is($email, "email")) { - $this->error(__('Email incorrect')); + $this->error(__('Email is incorrect')); } if ($mobile && !Validate::regex($mobile, "^1\d{10}$")) { - $this->error(__('Mobile incorrect')); + $this->error(__('Mobile is incorrect')); } $ret = $this->auth->register($username, $password, $email, $mobile, []); if ($ret) @@ -190,7 +190,7 @@ class User extends Api } if (!Validate::is($email, "email")) { - $this->error(__('Mobile incorrect')); + $this->error(__('Email is incorrect')); } if (\app\common\model\User::where('email', $email)->where('id', '<>', $user->id)->find()) { @@ -227,7 +227,7 @@ class User extends Api } if (!Validate::regex($mobile, "^1\d{10}$")) { - $this->error(__('Mobile incorrect')); + $this->error(__('Mobile is incorrect')); } if (\app\common\model\User::where('mobile', $mobile)->where('id', '<>', $user->id)->find()) { @@ -236,7 +236,7 @@ class User extends Api $result = Sms::check($mobile, $captcha, 'changemobile'); if (!$result) { - $this->error(__('Captcha invalid')); + $this->error(__('Captcha is incorrect')); } $verification = $user->verification; $verification->mobile = 1; @@ -300,7 +300,7 @@ class User extends Api } if ($mobile && !Validate::regex($mobile, "^1\d{10}$")) { - $this->error(__('Mobile incorrect')); + $this->error(__('Mobile is incorrect')); } $user = \app\common\model\User::getByMobile($mobile); if (!$user) @@ -310,7 +310,7 @@ class User extends Api $ret = Sms::check($mobile, $captcha, 'resetpwd'); if (!$ret) { - $this->error(__('Captcha invalid')); + $this->error(__('Captcha is incorrect')); } Sms::flush($mobile, 'resetpwd');