We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#9 也是这个问题 例如 访问admin模块 abc.php/index/login.html login方法里面输出:dump(url('index/login')->build()); 对应的结果是:abc.php/admin/index/login.html,这个网址是没法正常访问的 login方法里面输出:dump(url('/index/login')->build()); 或者dump(url('@index/login')->build());是正常的,但是这样感觉不符合使用习惯
parseUrl里面进行应用绑定判断,如果绑定过应用就不加前面的应用,代码修改如下,测试过是可以解决此问题,不知是否影响到其他功能,所以没有PR,只是把代码贴出来了
protected function parseUrl(string $url, &$domain): string { $request = $this->app->request; if (0 === strpos($url, '/')) { // 直接作为路由地址解析 $url = substr($url, 1); } elseif (false !== strpos($url, '\\')) { // 解析到类 $url = ltrim(str_replace('\\', '/', $url), '/'); } elseif (0 === strpos($url, '@')) { // 解析到控制器 $url = substr($url, 1); } elseif ('' === $url) { //判断是否绑定 if( $this->app->http->isBind() ) { $url = $request->controller().'/'.$request->action(); }else{ $url = $this->app->http->getName().'/'.$request->controller().'/'.$request->action(); } } else { // 解析到 应用/控制器/操作 $controller = $request->controller(); $app = $this->app->http->getName(); $path = explode('/', $url); $action = array_pop($path); $controller = empty($path) ? $controller : array_pop($path); $app = empty($path) ? $app : array_pop($path); $url = $controller . '/' . $action; $bind = $this->app->config->get('app.domain_bind', []); if ($key = array_search($app, $bind)) { $domain = is_bool($domain) ? $key : $domain; } else { //判断是否绑定 if( !$this->app->http->isBind() ){ $map = $this->app->config->get('app.app_map', []); if ($key = array_search($app, $map)) { $url = $key . '/' . $url; } else { $url = $app . '/' . $url; } } } }
The text was updated successfully, but these errors were encountered:
https://www.kancloud.cn/thinkphp/thinkphp6-quickstart/1352494应该是BUG 手册在【多入口文件】章节写了
Sorry, something went wrong.
哎 木有人修复撒
No branches or pull requests
#9 也是这个问题
例如
访问admin模块 abc.php/index/login.html
login方法里面输出:dump(url('index/login')->build());
对应的结果是:abc.php/admin/index/login.html,这个网址是没法正常访问的
login方法里面输出:dump(url('/index/login')->build()); 或者dump(url('@index/login')->build());是正常的,但是这样感觉不符合使用习惯
parseUrl里面进行应用绑定判断,如果绑定过应用就不加前面的应用,代码修改如下,测试过是可以解决此问题,不知是否影响到其他功能,所以没有PR,只是把代码贴出来了
The text was updated successfully, but these errors were encountered: