发文章登录判断

This commit is contained in:
toogee 2020-01-18 13:10:32 +08:00
parent a167ea6467
commit f0027c1fdb
5 changed files with 7 additions and 7 deletions

View File

@ -9,7 +9,7 @@ class LogedCheck
{ {
//已登陆跳出 //已登陆跳出
if(Session::has('user_id')){ if(Session::has('user_id')){
return redirect('user/index'); return redirect('/index/user/index');
} }
return $next($request); return $next($request);
} }

View File

@ -11,7 +11,7 @@ class LoginCheck
if(Session::has('user_id')){ if(Session::has('user_id')){
return $next($request); return $next($request);
} else { } else {
return redirect('/login/index'); return redirect('/index/login');
} }
} }
} }

View File

@ -25,7 +25,7 @@ return [
'deny_app_list' => [], 'deny_app_list' => [],
// 异常页面的模板文件 // 异常页面的模板文件
'exception_tmpl' => app()->getThinkPath() . 'tpl/think_exception.tpl', 'exception_tmpl' => '../view/404.html',
// 错误显示信息,非调试模式有效 // 错误显示信息,非调试模式有效
'error_message' => '页面错误!请稍后再试~', 'error_message' => '页面错误!请稍后再试~',

View File

@ -817,13 +817,13 @@ layui.define(['layer', 'laytpl', 'form', 'element', 'upload', 'util'], function(
loading = layer.load(2, { loading = layer.load(2, {
shade: [0.2, '#000'] shade: [0.2, '#000']
}); });
location.href = '/add'; location.href = '/index/add';
} else { } else {
layer.msg('请先登陆',{ layer.msg('请先登陆',{
icon:5, icon:5,
time:2000 time:2000
},function () { },function () {
location.href = '/login/index'; location.href = '/index/login';
}); });
} }
return false; return false;
@ -856,7 +856,7 @@ layui.define(['layer', 'laytpl', 'form', 'element', 'upload', 'util'], function(
,click: function(type){ ,click: function(type){
if(type === 'bar1'){ if(type === 'bar1'){
//slayer.msg('打开 index.js开启发表新帖的路径'); //slayer.msg('打开 index.js开启发表新帖的路径');
location.href = '/add'; location.href = '/index/add';
} }
} }
}); });

View File

@ -215,7 +215,7 @@
{volist name="ad_comm" id="vo"} {volist name="ad_comm" id="vo"}
<a href="{$vo.slid_href}" target="_blank"><img src="{$vo.slid_img}" style="max-width: 100%;"></a> <a href="{$vo.slid_href}" target="_blank"><img src="{$vo.slid_img}" style="max-width: 100%;"></a>
{/volist} {/volist}
<p style="position: relative; color: #666;">微信扫码关注 layui 公众号</p> <p style="position: relative; color: #666;">QQ扫码加入TaoLer官群</p>
</div> </div>
</div> </div>