新装系统测试会员注册问题

安装报错 · cheaco · 于 3年前 发布 · 1547 次阅读

测试后发现后台有新会员注册资料,但是前台出现代码

Invalid Argument – yii\base\InvalidArgumentException Invalid path alias: @services/email/views/customer/account/register/body_en.php

  1. in /www/wwwroot/www.*****.com/vendor/yiisoft/yii2/BaseYii.phpat line 154 145146147148149150151152153154155156157158159160161162163
         foreach (static::$aliases[$root] as $name => $path) {
             if (strpos($alias . '/', $name . '/') === 0) {
                 return $path . substr($alias, strlen($name));
             }
         }
     }
    
    if ($throwException) {
        throw new InvalidArgumentException("Invalid path alias: $alias");
    }

    return false;
}

/**
 * Returns the root alias part of a given alias.
 * A root alias is an alias that has been registered via [[setAlias()]] previously.
 * If a given alias matches multiple root aliases, the longest one will be returned.
  1. in /www/wwwroot/www.*****.com/vendor/fancyecommerce/fecshop/services/Email.php at line 301– yii\BaseYii::getAlias('@services/email/views/customer/a...') 295296297298299300301302303304305306307
         return;
     }
     $defaultLangCode = Yii::$service->fecshoplang->defaultLangCode;
     // 得到body部分的配置数组
     $bodyViewFile = $viewPath.'/body_'.$langCode.'.php';
     $bodyViewFilePath = Yii::getAlias($bodyViewFile);
     if (!file_exists($bodyViewFilePath)) { //如果当前语言的模板不存在,则使用默认语言的模板。
         $bodyViewFile = $viewPath.'/body_'.$defaultLangCode.'.php';
         $bodyViewFilePath = Yii::getAlias($bodyViewFile);
     }
     $bodyConfig = [
         'class' => $widget,
    
  2. in /www/wwwroot/www.*****.com/vendor/fancyecommerce/fecshop/services/email/Customer.php at line 88– fecshop\services\Email::getSubjectAndBody('services\email\widgets\customer...', '@services/email/views/customer/a...', 'en', ['firstname' => 'le', 'lastname' => 'jack', 'email' => 'jack@88888.com', 'is_subscribed' => '1', ...]) 82838485868788899091929394 $widget = $registerInfo['widget'];
         }
         if (isset($registerInfo['viewPath']) && $registerInfo['viewPath']) {
             $viewPath = $registerInfo['viewPath'];
         }
         if ($widget && $viewPath) {
             list($subject, $htmlBody) = Yii::$service->email->getSubjectAndBody($widget, $viewPath, '', $emailInfo);
             $sendInfo = [
                 'to'        => $toEmail,
                 'subject'    => $subject,
                 'htmlBody' => $htmlBody,
                 'senderName'=> Yii::$service->store->currentStore,
             ];
    
  3. in /www/wwwroot/www.*****.com/vendor/fancyecommerce/fecshop/app/appfront/modules/Customer/block/account/Register.php at line 95– fecshop\services\email\Customer::sendRegisterEmail(['firstname' => 'le', 'lastname' => 'jack', 'email' => 'jack@88888.com', 'is_subscribed' => '1', ...]) 8990919293949596979899100101 $param['register_enable_token'] = $registerEnableToken;

                 Yii::$service->email->customer->sendRegisterEmail($param);
                 return true;
             }
         } else {
             Yii::$service->email->customer->sendRegisterEmail($param);
             return true;
         }
    
     }
    

    } }

  4. in /www/wwwroot/www.*****.com/vendor/fancyecommerce/fecshop/app/appfront/modules/Customer/block/account/Register.php at line 73– fecshop\app\appfront\modules\Customer\block\account\Register::sendRegisterEmail(['firstname' => 'le', 'lastname' => 'jack', 'email' => 'jack@88888.com', 'is_subscribed' => '1', ...]) 67686970717273747576777879 }

     Yii::$service->customer->register($param);
    
     $errors = Yii::$service->page->message->addByHelperErrors();
     if (!$errors) {
         // 发送注册邮件
         $this->sendRegisterEmail($param);
    
         return true;
     }
    

    }

    /**

  5. in /www/wwwroot/www.*****.com/vendor/fancyecommerce/fecshop/app/appfront/modules/Customer/controllers/AccountController.php at line 83– fecshop\app\appfront\modules\Customer\block\account\Register::register(['firstname' => 'le', 'lastname' => 'jack', 'email' => 'jack@88888.com', 'is_subscribed' => '1', ...]) 77787980818283848586878889 if (!Yii::$app->user->isGuest) {
         return Yii::$service->url->redirectByUrlKey('customer/account');
     }
     $param = Yii::$app->request->post('editForm');
     if (!empty($param) && is_array($param)) {
         $param = \Yii::$service->helper->htmlEncode($param);
         $registerStatus = $this->getBlock()->register($param);
         //echo $registerStatus;exit;
         if ($registerStatus) {
             // $params_register = Yii::$app->getModule('customer')->params['register'];
             $appName = Yii::$service->helper->getAppName();
             $registerSuccessAutoLogin = Yii::$app->store->get($appName.'_account', 'registerSuccessAutoLogin');
             $registerSuccessRedirectUrlKey = Yii::$app->store->get($appName.'_account', 'registerSuccessRedirectUrlKey');
    
  6. fecshop\app\appfront\modules\Customer\controllers\AccountController::actionRegister()
  7. in /www/wwwroot/www.*****.com/vendor/yiisoft/yii2/base/InlineAction.php at line 57– call_user_func_array([fecshop\app\appfront\modules\Customer\controllers\AccountController, 'actionRegister'], [])
  8. in /www/wwwroot/www.*****.com/vendor/yiisoft/yii2/base/Controller.php at line 180– yii\base\InlineAction::runWithParams([])
  9. in /www/wwwroot/www.*****.com/vendor/yiisoft/yii2/base/Module.php at line 528– yii\base\Controller::runAction('register', [])
  10. in /www/wwwroot/www.*****.com/vendor/yiisoft/yii2/web/Application.php at line 103– yii\base\Module::runAction('customer/account/register', [])
  11. in /www/wwwroot/www.*****.com/vendor/yiisoft/yii2/base/Application.php at line 386– yii\web\Application::handleRequest(fecshop\yii\web\Request)
  12. in /www/wwwroot/www.****.com/appfront/web/index.php at line 66– yii\base\Application::run() 60616263646566 使用方法:Yii::$service->cms->article;
    • 上面的例子就是获取cms服务的子服务article。 */ new fecshop\services\Application($config);

$application = new yii\web\Application($config); $application->run()

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

自己先去看看markdown语法吧:http://www.fecmall.com/markdown

内容乱的没法看

Fecmall#23年前 0 个赞

你这个帖子,和这个一个问题:http://www.fecmall.com/topic/4430

自己乱改后台邮件配置内容导致的

先还原回来配置,如果要重写,请将view等路径写正确,不然还是报错

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