提交 c0f1888f 编写于 作者: G gongfuxiang

细节优化

上级 fb4c2a8f
<?php
// +----------------------------------------------------------------------
// | ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
// 根目录入口
define('IS_ROOT_ACCESS', true);
// 引入公共入口文件
require './public/api.php';
?>
\ No newline at end of file
......@@ -437,15 +437,9 @@ function MyUrl($path, $params=[])
// 避免从后台生成url入口错误
$script_name = CurrentScriptName();
if($script_name != 'index.php')
if($script_name != 'index.php' && substr($path, 0, 6) != 'admin/')
{
if(substr($path, 0, 6) == 'index/')
{
$url = str_replace($script_name, 'index.php', $url);
} elseif(substr($path, 0, 4) == 'api/')
{
$url = str_replace($script_name, 'api.php', $url);
}
$url = str_replace($script_name, 'index.php', $url);
}
return $url;
......
<?php
// +----------------------------------------------------------------------
// | ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
// [ 接口入口文件 ]
namespace think;
// 加载基础文件
require __DIR__ . '/../thinkphp/base.php';
// 支持事先使用静态方法设置Request对象和Config对象
// 引入公共入口文件
require __DIR__.'/core.php';
// 执行应用并响应
Container::get('app')->run()->send();
?>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册