From 96eea18e3a4e3026bcde10f4b276d51aa564a3bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=80=A1=E6=A0=8B?= Date: Thu, 9 Sep 2021 16:36:01 +0800 Subject: [PATCH] * adjust for tid. --- framework/router.class.php | 10 ++++++---- module/user/control.php | 1 + www/js/my.full.js | 4 +++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/framework/router.class.php b/framework/router.class.php index 07f5135d4c..3ecd8d357b 100755 --- a/framework/router.class.php +++ b/framework/router.class.php @@ -597,13 +597,15 @@ class router extends baseRouter */ public function getURI($full = false) { - $URI = !empty($this->rawURI) ? $this->rawURI : $this->URI; + $URI = !empty($this->rawURI) ? $this->rawURI : $this->URI; + $tidParam = ($this->config->requestType == 'PATH_INFO' and helper::isWithTID()) ? "?tid={$_GET['tid']}" : ''; + if($full and $this->config->requestType == 'PATH_INFO') { - if($URI) return $this->config->webRoot . $URI . '.' . $this->viewType; - return $this->config->webRoot; + if($URI) return $this->config->webRoot . $URI . '.' . $this->viewType . $tidParam; + return $this->config->webRoot . $tidParam; } - return $URI; + return $URI . $tidParam; } /** diff --git a/module/user/control.php b/module/user/control.php index c2330563f2..9306da2247 100644 --- a/module/user/control.php +++ b/module/user/control.php @@ -487,6 +487,7 @@ class user extends control { $this->referer = $this->server->http_referer ? $this->server->http_referer: ''; if(!empty($referer)) $this->referer = helper::safe64Decode($referer); + if($this->post->referer) $this->referer = $this->post->referer; /* Build zentao link regular. */ $webRoot = $this->config->webRoot; diff --git a/www/js/my.full.js b/www/js/my.full.js index 8f7a503fbd..189f9c2a0c 100644 --- a/www/js/my.full.js +++ b/www/js/my.full.js @@ -54,6 +54,9 @@ } } sessionStorage.setItem('TID', _tid); + + var link = $.parseLink(window.location.href); + if(!link.tid) window.location.href = convertUrlWithTid(window.location.href, _tid); } $.tabSession = @@ -62,7 +65,6 @@ convertUrlWithTid: convertUrlWithTid, }; - /* Handle all links in page */ $('a').each(function() {