优化安装报错问题

This commit is contained in:
2026-04-10 10:37:19 +08:00
parent 9b039b7abe
commit aede7248ca
8 changed files with 58 additions and 17 deletions

View File

@@ -668,7 +668,7 @@ class Install extends Api
/**
* 获取安装完成后的访问地址(根据请求来源区分 API 与前端开发模式)
* - 通过 API 访问8787index.html#/admin、index.html#/
* - 通过 API 访问8787index#/admin、index#/(无 index 与 # 之间的斜杠)
* - 通过前端开发服务访问1818/#/admin、/#/
*/
public function accessUrls(Request $request): Response
@@ -680,7 +680,8 @@ class Install extends Api
$port = substr($host, strrpos($host, ':') + 1);
}
$scheme = $request->header('x-forwarded-proto', 'http');
$base = rtrim($scheme . '://' . $host, '/');
$basePath = $request instanceof \support\Request ? $request->publicBasePath() : '';
$base = rtrim($scheme . '://' . $host, '/') . $basePath;
if ($port === '1818') {
$adminUrl = $base . '/#/admin';