|
|
@@ -13,8 +13,8 @@ use yii\helpers\Json;
|
|
|
|
|
|
class InformUserController extends BaseController
|
|
|
{
|
|
|
-
|
|
|
- //发送短信
|
|
|
+
|
|
|
+ //申请开店提交资料时发送验证码 shish 2020.3.8
|
|
|
public function actionSendSms()
|
|
|
{
|
|
|
$get = Yii::$app->request->get();
|
|
|
@@ -23,16 +23,13 @@ class InformUserController extends BaseController
|
|
|
if (stringUtil::isMobile($mobile) == false) {
|
|
|
util::fail('请填写手机号');
|
|
|
}
|
|
|
-
|
|
|
$code = stringUtil::getRandNum(4);
|
|
|
$msg = "您的验证码:" . $code . "。为了您的帐号安全,验证码不要告诉别人哦";
|
|
|
$userId = $this->userId;
|
|
|
+
|
|
|
+ $cacheKey = 'OPEN_SHOP_APPLY_' . $userId;
|
|
|
+ Yii::$app->redis->executeCommand('SETEX', [$cacheKey, 120, $code]);
|
|
|
|
|
|
- if ($type == 1) {
|
|
|
-
|
|
|
- } else {
|
|
|
- util::fail('发送失败');
|
|
|
- }
|
|
|
sms::send($mobile, $msg);
|
|
|
util::ok('已发送');
|
|
|
}
|