mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-08 15:42:48 +08:00
改进
This commit is contained in:
@@ -85,6 +85,10 @@ return [
|
|||||||
'url_domain_deploy' => false,
|
'url_domain_deploy' => false,
|
||||||
// 域名根,如.thinkphp.cn
|
// 域名根,如.thinkphp.cn
|
||||||
'url_domain_root' => '',
|
'url_domain_root' => '',
|
||||||
|
// 是否自动转换URL中的控制器名
|
||||||
|
'url_controller_convert' => true,
|
||||||
|
// 是否自动转换URL中的操作名
|
||||||
|
'url_action_convert' => true,
|
||||||
|
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 视图及模板设置
|
// | 视图及模板设置
|
||||||
|
|||||||
@@ -215,11 +215,11 @@ class App
|
|||||||
|
|
||||||
// 获取控制器名
|
// 获取控制器名
|
||||||
$controllerName = strip_tags($result[1] ?: Config::get('default_controller'));
|
$controllerName = strip_tags($result[1] ?: Config::get('default_controller'));
|
||||||
define('CONTROLLER_NAME', $config['url_controller_convert'] ? strtolower($controllerName) : $controllerName);
|
define('CONTROLLER_NAME', Config::get('url_controller_convert') ? strtolower($controllerName) : $controllerName);
|
||||||
|
|
||||||
// 获取操作名
|
// 获取操作名
|
||||||
$actionName = strip_tags($result[2] ?: Config::get('default_action'));
|
$actionName = strip_tags($result[2] ?: Config::get('default_action'));
|
||||||
define('ACTION_NAME', $config['url_action_convert'] ? strtolower($actionName) : $actionName);
|
define('ACTION_NAME', Config::get('url_action_convert') ? strtolower($actionName) : $actionName);
|
||||||
|
|
||||||
// 执行操作
|
// 执行操作
|
||||||
if (!preg_match('/^[A-Za-z](\/|\.|\w)*$/', CONTROLLER_NAME)) {
|
if (!preg_match('/^[A-Za-z](\/|\.|\w)*$/', CONTROLLER_NAME)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user