From b42d97b7cbe80c79080beab2d2819f313cc403db Mon Sep 17 00:00:00 2001 From: toogee Date: Tue, 2 Jun 2020 17:41:56 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E7=AB=AFapp=E9=80=82?= =?UTF-8?q?=E9=85=8D=E5=92=8C=E7=99=BB=E9=99=86=E8=B7=B3=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/index/controller/Login.php | 14 +++++++++++--- view/taoler/index/public/base.html | 7 ++++++- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/app/index/controller/Login.php b/app/index/controller/Login.php index 695c96b..71de334 100644 --- a/app/index/controller/Login.php +++ b/app/index/controller/Login.php @@ -21,7 +21,15 @@ class Login extends BaseController //用户登陆 public function index() { - //var_dump($_SERVER); + //获取登录前访问页面refer + $refer = Request::server('HTTP_REFERER'); + $domain = Request::domain(); + //截取域名后面的字符 + $url = substr($refer,strlen($domain)); + if(empty($url)){ + $url = '/'; + } + Cookie::set('url',$url); if(Request::isAjax()) { $data = Request::param(); @@ -59,8 +67,8 @@ class Login extends BaseController if ($res == 1) { //获取系统站内通知信息 Message::insertMsg(session('user_id')); - - return json(['code'=>0,'msg'=>'登陆成功','url'=>'/']); + //跳转到登陆前页面 + return json(['code'=>0,'msg'=>'登陆成功','url'=> Cookie::get('url')]); } else { return json(['code'=>-1,'msg'=>$res]); } diff --git a/view/taoler/index/public/base.html b/view/taoler/index/public/base.html index 55e585b..ca89f34 100644 --- a/view/taoler/index/public/base.html +++ b/view/taoler/index/public/base.html @@ -12,7 +12,10 @@ /*5+ 引擎环境下自动隐藏无关元素*/ .html5plus .html5plus-hide { display: none - } + } + {if strpos($Request.SERVER.HTTP_USER_AGENT,"Html5Plus") !== false} + html body{margin-top: 1px;} + {/if} @@ -22,7 +25,9 @@ document.body.classList.add("html5plus"); } +{if strpos($Request.SERVER.HTTP_USER_AGENT,"Html5Plus") === false} {include file="public/header" /} +{/if} {block name="column"}导航{/block} {block name="content"}内容{/block} {include file="public/footer" /}