diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 7be5818e4..9086b7f48 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -849,12 +849,12 @@ "source": { "type": "git", "url": "https://github.com/zoujingli/ThinkLibrary.git", - "reference": "dab37cf567def670988c452943022ff1b8bb4176" + "reference": "283b25735511092a6c1c48e4d55b919cf1e09e30" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/dab37cf567def670988c452943022ff1b8bb4176", - "reference": "dab37cf567def670988c452943022ff1b8bb4176", + "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/283b25735511092a6c1c48e4d55b919cf1e09e30", + "reference": "283b25735511092a6c1c48e4d55b919cf1e09e30", "shasum": "", "mirrors": [ { @@ -871,7 +871,7 @@ "ext-mbstring": "*", "topthink/framework": "^6.0" }, - "time": "2021-05-27T02:17:00+00:00", + "time": "2021-06-18T08:57:57+00:00", "default-branch": true, "type": "library", "extra": { diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 08a61b514..2e44dd24a 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -5,7 +5,7 @@ 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), - 'reference' => '1eaff7a50b3fc13c01311c222522c6070ff7e35b', + 'reference' => '43a8afea8902a5269d27519ebb31caa0705e2c82', 'name' => 'zoujingli/thinkadmin', 'dev' => false, ), @@ -144,7 +144,7 @@ 'aliases' => array( 0 => '9999999-dev', ), - 'reference' => 'dab37cf567def670988c452943022ff1b8bb4176', + 'reference' => '283b25735511092a6c1c48e4d55b919cf1e09e30', 'dev_requirement' => false, ), 'zoujingli/thinkadmin' => array( @@ -153,7 +153,7 @@ 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), - 'reference' => '1eaff7a50b3fc13c01311c222522c6070ff7e35b', + 'reference' => '43a8afea8902a5269d27519ebb31caa0705e2c82', 'dev_requirement' => false, ), 'zoujingli/wechat-developer' => array( diff --git a/vendor/services.php b/vendor/services.php index d68db52cb..e7c75c8b9 100644 --- a/vendor/services.php +++ b/vendor/services.php @@ -1,5 +1,5 @@ 'think\\admin\\Library', diff --git a/vendor/zoujingli/think-library/src/service/SystemService.php b/vendor/zoujingli/think-library/src/service/SystemService.php index 2bb8aee5e..2c2d12001 100644 --- a/vendor/zoujingli/think-library/src/service/SystemService.php +++ b/vendor/zoujingli/think-library/src/service/SystemService.php @@ -157,10 +157,19 @@ class SystemService extends Service */ public function sysuri(string $url = '', array $vars = [], $suffix = true, $domain = false): string { - [$hm, $bs] = [$this->app->config->get('route.url_html_suffix', 'html'), $this->app->route->buildUrl('@')->suffix(false)->domain($domain)->build()]; - [$d1, $d2, $d3] = [$this->app->config->get('app.default_app'), Str::snake($this->app->config->get('route.default_controller')), $this->app->config->get('route.default_action')]; - $pattern = ["#^({$bs}){$d1}/{$d2}/{$d3}(\.{$hm}|^\w|\?|$)?#i", "#^({$bs}[\w\.]+)/{$d2}/{$d3}(\.{$hm}|^\w|\?|$)#i", "#^({$bs}[\w\.]+)(/[\w\.]+)/{$d3}(\.{$hm}|^\w|$)#i"]; - return preg_replace($pattern, ['$1$2', '$1$2', '$1$2$3'], $this->app->route->buildUrl($url, $vars)->suffix($suffix)->domain($domain)->build()); + $ext = $this->app->config->get('route.url_html_suffix', 'html'); + $pre = $this->app->route->buildUrl('@')->suffix(false)->domain($domain)->build(); + $uri = $this->app->route->buildUrl($url, $vars)->suffix($suffix)->domain($domain)->build(); + // 默认节点配置数据 + $app = $this->app->config->get('app.default_app'); + $act = Str::lower($this->app->config->get('route.default_action')); + $ctr = Str::snake($this->app->config->get('route.default_controller')); + // 替换省略链接路径 + return preg_replace([ + "#^({$pre}){$app}/{$ctr}/{$act}(\.{$ext}|^\w|\?|$)?#i", + "#^({$pre}[\w\.]+)/{$ctr}/{$act}(\.{$ext}|^\w|\?|$)#i", + "#^({$pre}[\w\.]+)(/[\w\.]+)/{$act}(\.{$ext}|^\w|\?|$)#i", + ], ['$1$2', '$1$2', '$1$2$3'], $uri); } /**