在我的本地环境, 默认语言是中文, 在前台pc分类列表页 切换成为英文后, 再次点击排序或者点击左侧的属性筛选都会出现404页面. 官网的演示页面也是这种情况.如图

经排查我找到了问题所在:fecshop\services\Url
/**
* get current url.
*/
public function getCurrentUrl()
{
if (!$this->_currentUrl) {
$pageURL = $this->getBaseUrl() . $_SERVER['REQUEST_URI'];
$this->_currentUrl = $pageURL;
}
return $this->_currentUrl;
}
# echo $pageURL
结果:http://appfront.fecshoptest.com/en/en/wedding?color=green
然后我重写了Url service ,修改完成后是这样子的:
/**
* get current url.
* 有修改 18-5-27 下午11:59
* Yii::$app->urlManager->hostInfo
*/
public function getCurrentUrl()
{
if (!$this->_currentUrl) {
$pageURL = Yii::$app->urlManager->hostInfo . $_SERVER['REQUEST_URI'];
$this->_currentUrl = $pageURL;
}
return $this->_currentUrl;
}
echo $pageURL
结果:http://appfront.fecshoptest.com/en/wedding?color=green
现在解决了问题, 但不知道会不会影响其他页面功能,目前还没发现.