From 74079910374a0bfcff612ffc0064d24b648c6091 Mon Sep 17 00:00:00 2001 From: AGD Date: Sat, 27 Jul 2019 22:48:24 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E5=8F=91=E5=B8=83=208.8=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E5=89=8D=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/user/controller/Auth.php | 5 +- resources/views/_layout/default.blade.php | 66 ++++++++++------- resources/views/_layout/header.blade.php | 89 +++++++++++------------ resources/views/user/auth/index.blade.php | 8 +- resources/views/user/auth/read.blade.php | 13 +++- 5 files changed, 101 insertions(+), 80 deletions(-) diff --git a/application/user/controller/Auth.php b/application/user/controller/Auth.php index c002df5..0bd55c9 100644 --- a/application/user/controller/Auth.php +++ b/application/user/controller/Auth.php @@ -14,7 +14,9 @@ class Auth extends Controller 'UserAuthorize' => [ 'except' => [ 'create', - 'save' + 'save', + 'index', + 'read' ] ], 'GodAuthorize' => [ @@ -78,6 +80,7 @@ public function read($id) $user = User::find($id); $this->assign([ 'user' => $user, + 'session' => Session::get('user') ]); return $this->fetch(); } diff --git a/resources/views/_layout/default.blade.php b/resources/views/_layout/default.blade.php index 1871d55..d510bf0 100644 --- a/resources/views/_layout/default.blade.php +++ b/resources/views/_layout/default.blade.php @@ -1,32 +1,48 @@ - - - - - - - - @yield('title') -- ThinkPHP 入门教程 - - - + + + + + + + + @yield('title') -- ThinkPHP 入门教程 + + + - - @include('_layout.header') -
- @yield('content') + +
+
+
+ @include('_layout.header') +
+
+
    +
  • + + + + @yield('title') +
  • +
  • + @yield('content') +
  • +
+
+
+ @include('_layout.footer') +
- @include('_layout.footer') - - - - - +
+ + + + + + + \ No newline at end of file diff --git a/resources/views/_layout/header.blade.php b/resources/views/_layout/header.blade.php index 49d7090..6ded352 100644 --- a/resources/views/_layout/header.blade.php +++ b/resources/views/_layout/header.blade.php @@ -1,51 +1,48 @@
-
- -
+ + @else +
  • + + 注册 + +
  • +
  • + + 登录 + +
  • + @endif + +
    \ No newline at end of file diff --git a/resources/views/user/auth/index.blade.php b/resources/views/user/auth/index.blade.php index 33f8f81..031f92b 100644 --- a/resources/views/user/auth/index.blade.php +++ b/resources/views/user/auth/index.blade.php @@ -1,18 +1,14 @@ @extends('_layout.default') @section('title', '查看所有用户') @section('content') -
    -

    - 所有用户 -

    - +
    @foreach ($users as $user)
    {{ $user->name }} - @if ($god) + @if ($god && !$user->god)
    @php echo token() @endphp diff --git a/resources/views/user/auth/read.blade.php b/resources/views/user/auth/read.blade.php index c0aec26..f3d0422 100644 --- a/resources/views/user/auth/read.blade.php +++ b/resources/views/user/auth/read.blade.php @@ -4,8 +4,17 @@
    -

    欢迎您 {{ $user->name }}

    - 编辑资料 +

    + @if(!is_null($session) && $session->id === $user->id) + + 编辑资料 + + 欢迎您 + @else + 您正在查看 + @endif + {{ $user->name }} +