微信小程序手机号登录时无法获取手机验证码

bug问题 · jiahao1124 · 于 9个月前 发布 · 529 次阅读

调用获取手机验证码接口时 https://appserver.jk5u.net/customer/register/phoneregistercaptchacode 提示404

共收到 2 条回复 问题提问
Fecmall#19个月前 0 个赞

1.你下载的是fecyo对应的微信小程序,因此你需要先安装一下fecyo扩展

http://www.fecmall.com/doc/fecshop-guide/addons/cn-2.0/guide-fecmall-addons-install.html

http://www.fecmall.com/doc/fecmall-guide/fecyo/cn-1.0/guide-fecmall-fecyo-install.html

2.fecyo扩展安装后,就有这个函数了

<?php
/**
 * FecShop file.
 *
 * @link http://www.fecshop.com/
 * @copyright Copyright (c) 2016 FecShop Software LLC
 * @license http://www.fecshop.com/license/
 */

namespace fecyo\app\appserver\modules\Customer\controllers;

use fecshop\app\appserver\modules\AppserverController;
use Yii;
use \Firebase\JWT\JWT;

/**
 * @author Terry Zhao <2358269014@qq.com>
 * @since 1.0
 */
class RegisterController extends \fecshop\app\appserver\modules\Customer\controllers\RegisterController
{
    /**
     * 【账户注册】获取手机验证码
     */
    public function actionPhoneregistercaptchacode()
    {
        if(Yii::$app->request->getMethod() === 'OPTIONS'){
            return [];
        }
        $phoneNumber = Yii::$app->request->post('phone');
        if (!Yii::$service->sms->sendRegisterCapchaCode($phoneNumber)) {
            $errors = Yii::$service->helper->errors->get(',');
            
            $code = Yii::$service->helper->appserver->account_phone_send_sms_fail;
            $data = [ 'errors' => $errors ];
            $responseData = Yii::$service->helper->appserver->getResponseData($code, $data);
            
            return $responseData;
        }
        $code = Yii::$service->helper->appserver->status_success;
        $data = [];
        $responseData = Yii::$service->helper->appserver->getResponseData($code, $data);
        
        return $responseData;
    }
    
    
    
}
jiahao1124#29个月前 0 个赞

非常感谢!!!

添加回复 (需要登录)
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册
Your Site Analytics