|
|
@@ -116,7 +116,15 @@ class LoginForm extends Model {
|
|
|
throw new Exception('账号不存在');
|
|
|
}
|
|
|
// 校验邮箱验证码
|
|
|
- $codeObj = EmailLog::findOneAsArray('ADMIN_ID=:ADMIN_ID AND EMAIL=:EMAIL', [':ADMIN_ID' => $this->_user['ID'], ':EMAIL' => $this->_user['EMAIL']]);
|
|
|
+ $codeObj = EmailLog::find()
|
|
|
+ ->where('ADMIN_ID=:ADMIN_ID AND EMAIL=:EMAIL',
|
|
|
+ [
|
|
|
+ ':ADMIN_ID' => $this->_user['ID'],
|
|
|
+ ':EMAIL' => $this->_user['EMAIL'],
|
|
|
+ ])
|
|
|
+ ->orderBy('CREATED_AT DESC')
|
|
|
+ ->one()
|
|
|
+ ->toArray();
|
|
|
if (!$codeObj || !$codeObj['CODE'] || $codeObj['CODE'] != $this->code) {
|
|
|
throw new Exception('邮箱验证码不正确,无法登录');
|
|
|
}
|