From cc51f1192c2ade288db475e7f680feec8eb40bd4 Mon Sep 17 00:00:00 2001 From: Devil Date: Wed, 26 May 2021 19:54:44 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=99=BB=E5=BD=95=E6=B3=A8?= =?UTF-8?q?=E5=86=8C=E5=9B=9E=E8=B0=83=E5=9C=B0=E5=9D=80=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/index/controller/User.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/application/index/controller/User.php b/application/index/controller/User.php index ff015ebaa..9d63ed3a0 100755 --- a/application/index/controller/User.php +++ b/application/index/controller/User.php @@ -57,15 +57,28 @@ class User extends Common $referer_url = empty($_SERVER['HTTP_REFERER']) ? MyUrl('index/user/index') : htmlentities($_SERVER['HTTP_REFERER']); if(!empty($_SERVER['HTTP_REFERER'])) { + // 是否是指定页面,则赋值用户中心 $all = ['login', 'regster', 'forget', 'logininfo', 'reginfo', 'smsreginfo', 'emailreginfo', 'forgetpwdinfo']; + $status = false; foreach($all as $v) { if(strpos($_SERVER['HTTP_REFERER'], $v) !== false) { $referer_url = MyUrl('index/user/index'); + $status = true; break; } } + + // 未匹配到指定页面 + if(!$status) + { + // 非商城域名,则赋值用户中心 + if(GetUrlHost($referer_url) != GetUrlHost(__MY_URL__)) + { + $referer_url = MyUrl('index/user/index'); + } + } } return $referer_url; }