-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Administrator
committed
Mar 9, 2018
1 parent
4285a03
commit b6476a6
Showing
24 changed files
with
285 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
namespace App\Http\Middleware; | ||
|
||
use Closure; | ||
use Auth; | ||
|
||
class CheckLogin | ||
{ | ||
/** | ||
* Handle an incoming request. | ||
* | ||
* @param \Illuminate\Http\Request $request | ||
* @param \Closure $next | ||
* @return mixed | ||
*/ | ||
public function handle($request, Closure $next) | ||
{ | ||
if(auth()->check()){ | ||
return $next($request); | ||
|
||
} | ||
return redirect('/user/login')->withInput()->withErrors('请先登录'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
@extends('layouts.main') | ||
@section('container') | ||
<div class="fly-home fly-panel" style="background-image: url();"> | ||
<img src="{{ Auth::user()->avatar }}" alt="贤心"> | ||
<i class="iconfont icon-renzheng" title="Fly社区认证"></i> | ||
<h1> | ||
{{ Auth::user()->name }} | ||
<i class="iconfont @if(Auth::user()->sex == '男') icon-nan @else icon-nv @endif"></i> | ||
<!-- <i class="iconfont icon-nv"></i> --> | ||
{{--<i class="layui-badge fly-badge-vip">VIP3</i>--}} | ||
<!-- | ||
<span style="color:#c00;">(管理员)</span> | ||
<span style="color:#5FB878;">(社区之光)</span> | ||
<span>(该号已被封)</span> | ||
--> | ||
</h1> | ||
|
||
{{--<p style="padding: 10px 0; color: #5FB878;">认证信息:layui 作者</p>--}} | ||
|
||
<p class="fly-home-info"> | ||
<i class="iconfont icon-kiss" title="飞吻"></i><span style="color: #FF7200;">{{ Auth::user()->reward }} 飞吻</span> | ||
<i class="iconfont icon-shijian"></i><span>{{ Auth::user()->created_at->toDateString() }} 加入</span> | ||
<i class="iconfont icon-chengshi"></i><span>来自{{ Auth::user()->city }}</span> | ||
</p> | ||
|
||
<p class="fly-home-sign">({!! Auth::user()->sign !!})</p> | ||
|
||
<div class="fly-sns" data-user=""> | ||
<a href="javascript:;" class="layui-btn layui-btn-primary fly-imActive" data-type="addFriend">加为好友</a> | ||
<a href="javascript:;" class="layui-btn layui-btn-normal fly-imActive" data-type="chat">发起会话</a> | ||
</div> | ||
|
||
</div> | ||
|
||
<div class="layui-container"> | ||
<div class="layui-row layui-col-space15"> | ||
<div class="layui-col-md6 fly-home-jie"> | ||
<div class="fly-panel"> | ||
<h3 class="fly-panel-title">{{ Auth::user()->name }} 最近的提问</h3> | ||
<ul class="jie-row"> | ||
@if(Auth::user()->posts()->count()) | ||
@foreach(Auth::user()->posts as $post) | ||
<li> | ||
@if($post->is_top == 1) | ||
<span class="layui-badge layui-bg-orange">置顶</span> | ||
@endif | ||
@if($post->is_sticky == 1) | ||
<span class="layui-badge layui-bg-red">精</span> | ||
@endif | ||
<span class="layui-badge" style="{{ $post->category->tip_style }}">{{ $post->category->name }}</span> | ||
<a href="" class="jie-title"> {{ $post->title }}</a> | ||
<i>{{ $post->created_at->diffForHumans() }}</i> | ||
<em class="layui-hide-xs">{{ $post->renqi }}阅/{{ $post->comments->count() }}答</em> | ||
</li> | ||
@endforeach | ||
@else | ||
<div class="fly-none" style="min-height: 50px; padding:30px 0; height:auto;"><i style="font-size:14px;">没有发表任何求解</i></div> | ||
@endif | ||
</ul> | ||
</div> | ||
</div> | ||
|
||
<div class="layui-col-md6 fly-home-da"> | ||
<div class="fly-panel"> | ||
<h3 class="fly-panel-title">{{ Auth::user()->name }} 最近的回答</h3> | ||
<ul class="home-jieda"> | ||
@if(Auth::user()->comments->count()) | ||
@foreach(Auth::user()->comments as $comment) | ||
<li> | ||
<p> | ||
<span>{{ $comment->created_at->diffForHumans() }}</span> | ||
在<a href="/post/{{$comment->post->id}}" target="_blank">{{ $comment->post->title }}</a>中回答: | ||
</p> | ||
<div class="home-dacontent"> | ||
{!! $comment->content !!} | ||
</div> | ||
</li> | ||
@endforeach | ||
@else | ||
<div class="fly-none" style="min-height: 50px; padding:30px 0; height:auto;"><span>没有回答任何问题</span></div> | ||
@endif | ||
</ul> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
@endsection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
@extends('layouts.main') | ||
|
||
@section('container') | ||
<style> | ||
.post-list{ | ||
padding:0 10px; | ||
} | ||
</style> | ||
<div class="layui-container fly-marginTop fly-user-main"> | ||
@include('home.user.main') | ||
|
||
<div class="fly-panel fly-panel-user"> | ||
<!-- | ||
<div class="fly-msg" style="margin-top: 15px;"> | ||
您的邮箱尚未验证,这比较影响您的帐号安全,<a href="activate.html">立即去激活?</a> | ||
</div> | ||
--> | ||
<div class="layui-tab layui-tab-brief" lay-filter="user"> | ||
<ul class="layui-tab-title" id="LAY_mine"> | ||
<li data-type="mine-jie" lay-id="index" class="layui-this">我发的帖(<span>{{ Auth::user()->posts->count() }}</span>)</li> | ||
<li data-type="collection" data-url="/collection/find/" lay-id="collection">我收藏的帖(<span>16</span>)</li> | ||
</ul> | ||
<div class="layui-tab-content" style="padding: 20px 0;"> | ||
<div class="layui-tab-item layui-show"> | ||
<ul class="mine-view jie-row"> | ||
@foreach($posts as $post) | ||
<li class="post-list"> | ||
<a class="jie-title" style="" href="/post/{{ $post->id }}" target="_blank">{{ $post->title }}</a> | ||
<i>{{ $post->created_at->diffForHumans() }}</i> | ||
<a class="mine-edit" href="#">编辑</a> | ||
<em>{{ $post->renqi }}阅/{{ $post->comments->count() }}答</em> | ||
</li> | ||
@endforeach | ||
</ul> | ||
<div id="LAY_page"></div> | ||
</div> | ||
<div class="layui-tab-item"> | ||
<ul class="mine-view jie-row"> | ||
<li> | ||
<a class="jie-title" href="../jie/detail.html" target="_blank">基于 layui 的极简社区页面模版</a> | ||
<i>收藏于23小时前</i> </li> | ||
</ul> | ||
<div id="LAY_page1"></div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
@endsection |
Oops, something went wrong.