Closed lantongxue closed 2 years ago
主要原因是 AssetManager 的 basePath 为空,导致框架生成静态资源文件时找不到目录,大致逻辑代码如下
public $basePath = '@webroot/assets';
public $baseUrl = '@web/assets';
// some codes
public function init()
{
parent::init();
$this->basePath = Yii::getAlias($this->basePath);
$this->basePath = realpath($this->basePath);
$this->baseUrl = rtrim(Yii::getAlias($this->baseUrl), '/');
}
// some codes
解决
vendor/yiisoft/yii2/web/AssetManager.php:232
产生的异常