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" /}