移动端app适配和登陆跳回

This commit is contained in:
toogee 2020-06-02 17:41:56 +08:00
parent 0442cb5650
commit b42d97b7cb
2 changed files with 17 additions and 4 deletions

View File

@ -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]);
}

View File

@ -13,6 +13,9 @@
.html5plus .html5plus-hide {
display: none
}
{if strpos($Request.SERVER.HTTP_USER_AGENT,"Html5Plus") !== false}
html body{margin-top: 1px;}
{/if}
</style>
<script src="/static/share/plusShare.js" type="text/javascript" charset="utf-8"></script>
</head>
@ -22,7 +25,9 @@
document.body.classList.add("html5plus");
}
</script>
{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" /}