|
|
@@ -7,6 +7,7 @@
|
|
|
*/
|
|
|
namespace backendApi\modules\v1\controllers;
|
|
|
|
|
|
+use backendApi\modules\v1\components\UserAuth;
|
|
|
use common\helpers\snowflake\PageSnowFake;
|
|
|
use common\models\DealType;
|
|
|
use common\models\Period;
|
|
|
@@ -64,6 +65,18 @@ class SiteController extends BaseController
|
|
|
return static::notice(['pageId'=>$pageId]);
|
|
|
}
|
|
|
|
|
|
+ public function actionSendEmailCode()
|
|
|
+ {
|
|
|
+ $adminName = Yii::$app->request->get('adminName');
|
|
|
+ // 发送邮箱验证码
|
|
|
+ $result = UserAuth::sendEmailCode($adminName);
|
|
|
+ if ($result['code'] == 200) {
|
|
|
+ return static::notice(sprintf('验证码已发送到邮箱 %s, 有效期%d分钟. ', $result['email'], 5));
|
|
|
+ } else {
|
|
|
+ return static::notice(sprintf('验证码发送失败. %s', $result['errDes']), 401);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public function actionBaseInfo(){
|
|
|
// 会员级别
|
|
|
$decLevels = Cache::getDecLevelConfig();
|