|
@@ -5,7 +5,7 @@ namespace app\api\controller;
|
|
use app\common\controller\Api;
|
|
use app\common\controller\Api;
|
|
use app\common\library\Ems as Emslib;
|
|
use app\common\library\Ems as Emslib;
|
|
use app\common\model\User;
|
|
use app\common\model\User;
|
|
-
|
|
|
|
|
|
+use think\Validate;
|
|
/**
|
|
/**
|
|
* 邮箱验证码接口
|
|
* 邮箱验证码接口
|
|
*/
|
|
*/
|
|
@@ -39,7 +39,12 @@ class Ems extends Api
|
|
{
|
|
{
|
|
$email = $this->request->post("email");
|
|
$email = $this->request->post("email");
|
|
$event = $this->request->post("event");
|
|
$event = $this->request->post("event");
|
|
- $event = $event ? $event : 'register';
|
|
|
|
|
|
+ $event = '';
|
|
|
|
+
|
|
|
|
+ if (!Validate::is($email, "email")) {
|
|
|
|
+ $this->error(__('Please input correct email'));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
$last = Emslib::get($email, $event);
|
|
$last = Emslib::get($email, $event);
|
|
if ($last && time() - $last['createtime'] < 60) {
|
|
if ($last && time() - $last['createtime'] < 60) {
|