修正 Proxied、 SSL/TLS 设为 Flexible、开启 Always Use HTTPS

This commit is contained in:
root
2026-06-10 06:44:57 +08:00
parent a68b83fcbd
commit 5dea4c8b28
31 changed files with 950 additions and 160 deletions
+2 -7
View File
@@ -84,13 +84,8 @@ class Link extends Backend
$cfg = is_array($this->view->config ?? null) ? $this->view->config : [];
$version = (string) \think\Config::get('site.version');
$scriptUrl = (string) url('split.link/script', ['v' => $version], false, true);
if (strpos($scriptUrl, '?') === false) {
$scriptUrl .= '?v=' . $version;
}
if (strpos($scriptUrl, '://') === false) {
$scriptUrl = $this->request->domain() . $scriptUrl;
}
// 使用站内相对路径,避免生产环境 domain() 与反向代理/HTTPS 不一致导致 JS 跨域丢 Cookie
$scriptUrl = (string) url('split.link/script', ['v' => $version], '', false);
$cfg['jsname'] = $scriptUrl;
$this->view->assign('config', $cfg);
$this->view->config = $cfg;