细节优化

feat/task1-c-wallet
gongfuxiang 2019-06-23 00:41:34 +08:00
parent fb4c2a8f6c
commit c0f1888f62
3 changed files with 2 additions and 50 deletions

17
api.php
View File

@ -1,17 +0,0 @@
<?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';
?>

View 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;

View File

@ -1,25 +0,0 @@
<?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();
?>