Skip to content

Commit

Permalink
replace all route function to wzRoute for https support
Browse files Browse the repository at this point in the history
  • Loading branch information
mylxsw committed Apr 21, 2020
1 parent f9e5af9 commit 022b852
Show file tree
Hide file tree
Showing 13 changed files with 21 additions and 18 deletions.
2 changes: 1 addition & 1 deletion app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@ protected function unauthenticated($request, AuthenticationException $exception)
return response()->json(['error' => 'Unauthenticated.'], 401);
}

return redirect()->guest(route('login'));
return redirect()->guest(wzRoute('login'));
}
}
4 changes: 2 additions & 2 deletions app/Http/Controllers/DocumentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public function newPageHandle(Request $request, $id)
'project:doc:edit:show',
['id' => $projectID, 'page_id' => $pageItem->id]
),
'show' => route(
'show' => wzRoute(
'project:home',
['id' => $projectID, 'p' => $pageItem->id]
)
Expand Down Expand Up @@ -276,7 +276,7 @@ public function editPageHandle(Request $request, $id, $page_id)
'project:doc:edit:show',
['id' => $projectID, 'page_id' => $pageItem->id]
),
'show' => route(
'show' => wzRoute(
'project:home',
['id' => $projectID, 'p' => $pageItem->id]
)
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/ProjectController.php
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ public function groupPrivilegeRevoke(Request $request, $id, $group_id)
return redirect($redirectURL);
}

return redirect(route('project:setting:handle', ['id' => $id, 'op' => 'privilege']));
return redirect(wzRoute('project:setting:handle', ['id' => $id, 'op' => 'privilege']));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion app/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ function navigator(
'id' => (int)$page->id,
'name' => $page->title,
'pid' => (int)$page->pid,
'url' => route('project:home', ['id' => $projectID, 'p' => $page->id]),
'url' => wzRoute('project:home', ['id' => $projectID, 'p' => $page->id]),
'selected' => $pageID === (int)$page->id,
'type' => documentType($page->type),
'created_at' => $page->created_at,
Expand Down
2 changes: 1 addition & 1 deletion resources/views/catalog/catalogs.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
<td>{{ $cat->sort_level }}</td>
<td><i class="material-icons text-{{ ($cat->show_in_home ?? true) ? 'success':'warning' }}">{{ ($cat->show_in_home ?? true) ? 'check':'close' }}</i></td>
<td>
<a href="{!! route('admin:catalogs:view', ['id' => $cat->id]) !!}">
<a href="{!! wzRoute('admin:catalogs:view', ['id' => $cat->id]) !!}">
<i class="material-icons" title="编辑">create</i>
</a>
&nbsp;
Expand Down
2 changes: 1 addition & 1 deletion resources/views/components/sub-documents.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
@if(count($subItems) > 0)
<div class="list-group">
@foreach ($subItems as $item)
<a class="list-group-item" href="{{ route('project:home', ['id' => $project->id, 'p' => $item->id]) }}">
<a class="list-group-item" href="{{ wzRoute('project:home', ['id' => $project->id, 'p' => $item->id]) }}">
{{ $item->title }}
</a>
@endforeach
Expand Down
6 changes: 3 additions & 3 deletions resources/views/group/info.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

<div class="form-group">
<button type="submit" class="btn btn-primary btn-raised">添加</button>
<a href="{!! route('admin:groups') !!}" class="btn btn-default">@lang('common.btn_back')</a>
<a href="{!! wzRoute('admin:groups') !!}" class="btn btn-default">@lang('common.btn_back')</a>
</div>
</form>
</div>
Expand Down Expand Up @@ -144,9 +144,9 @@
<tr>
<th scope="row">{{ $project->id }}</th>
<td>
<a href="{!! route('project:home', ['id' => $project->id]) !!}">{{ $project->name }}</a>
<a href="{!! wzRoute('project:home', ['id' => $project->id]) !!}">{{ $project->name }}</a>
@if(!empty($project->catalog_id))
<a target="_blank" class="badge badge-pill badge-info" href="{{ route('home', ['catalog' => $project->catalog_id]) }}">#{{ $project->catalog->name ?? '' }}</a>
<a target="_blank" class="badge badge-pill badge-info" href="{{ wzRoute('home', ['catalog' => $project->catalog_id]) }}">#{{ $project->catalog->name ?? '' }}</a>
@endif
</td>
<td>{{ $project->pivot->privilege == 1 ? __('common.yes') : __('common.no') }}</td>
Expand Down
3 changes: 3 additions & 0 deletions resources/views/operations/recently.blade.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@

@foreach($logs as $log)
@if(empty($log->context->username))
@continue
@endif
<div class="media text-muted pt-3">
<img src="{{ user_face($log->context->username) }}" class="wz-userface-small">
<p class="media-body pb-3 mb-0 lh-125 border-bottom border-gray">
Expand Down
2 changes: 1 addition & 1 deletion resources/views/project/project.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<i class="fa fa-hashtag" style="color: #909090;" title="文档标题" data-toggle="tooltip"></i>
{{ $pageItem->title }}
@if($type == 'swagger')
<a title="原始Swagger文档" target="_blank" href="{{ route('swagger:doc:json', ['id' => $project->id, 'page_id' => $pageItem->id]) }}" class="fa fa-link"></a>
<a title="原始Swagger文档" target="_blank" href="{{ wzRoute('swagger:doc:json', ['id' => $project->id, 'page_id' => $pageItem->id]) }}" class="fa fa-link"></a>
@endif
</h1>
</nav>
Expand Down
6 changes: 3 additions & 3 deletions resources/views/search.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<div class="card-header">
<div class="card-header-title">
@if (!empty($project_id))
<button type="button" data-href="{{ route('project:home', ['id' => $project_id]) }}" class="btn btn-default bmd-btn-icon" id="wz-document-goback">
<button type="button" data-href="{{ wzRoute('project:home', ['id' => $project_id]) }}" class="btn btn-default bmd-btn-icon" id="wz-document-goback">
<i class="material-icons">arrow_back</i>
</button>
@endif
Expand Down Expand Up @@ -58,10 +58,10 @@
<img src="{{ user_face($doc->user->name) }}" class="wz-userface-small">
<p class="media-body pb-3 mb-0 lh-125 border-bottom border-gray wz-search-result">
<strong class="d-block text-gray-dark">
<a href="{{ route('project:home', ['id' => $doc->project_id, 'p' => $doc->id]) }}" style="font-size: 1.1rem;">{{ $doc->title }}</a>
<a href="{{ wzRoute('project:home', ['id' => $doc->project_id, 'p' => $doc->id]) }}" style="font-size: 1.1rem;">{{ $doc->title }}</a>
<span style="color: #a4a4a4;">{{ $doc->project->name ?? '' }}
@if(!empty($doc->project->catalog_id))
<a href="{{ route('home', ['catalog' => $doc->project->catalog_id]) }}">#{{ $doc->project->catalog->name ?? '' }}</a>
<a href="{{ wzRoute('home', ['catalog' => $doc->project->catalog_id]) }}">#{{ $doc->project->catalog->name ?? '' }}</a>
@endif
</span>
</strong>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/user/notifications.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<div class="card card-white">
<div class="card-body">
<div class="btn-group wz-nav-control">
<form action="{{ route('user:notifications:read-all') }}" method="post" id="form-notifications-readall">{{ method_field('PUT') }}{{ csrf_field() }}</form>
<form action="{{ wzRoute('user:notifications:read-all') }}" method="post" id="form-notifications-readall">{{ method_field('PUT') }}{{ csrf_field() }}</form>
<button class="btn btn-primary btn-raised" wz-form-submit data-form="#form-notifications-readall">全部标记为已读</button>
</div>

Expand Down
2 changes: 1 addition & 1 deletion resources/views/user/templates_edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<div class="card-header">编辑模板</div>
<div class="card-body">

<form class="form-horizontal" method="post" action="{{ route('user:templates:edit:handle', ['id' => $template->id]) }}" >
<form class="form-horizontal" method="post" action="{{ wzRoute('user:templates:edit:handle', ['id' => $template->id]) }}" >
{{ csrf_field() }}{{ method_field('PUT') }}

<div class="form-group" style="max-width: 300px;">
Expand Down
4 changes: 2 additions & 2 deletions resources/views/user/user.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@
<tr>
<td>{{ $proj->id }}</td>
<td>
<a href="{!! route('project:home', ['id' => $proj->id]) !!}">{{ $proj->name }}</a>
<a href="{!! wzRoute('project:home', ['id' => $proj->id]) !!}">{{ $proj->name }}</a>
@if(!empty($proj->catalog_id))
<a target="_blank" class="badge badge-pill badge-info" href="{{ route('home', ['catalog' => $proj->catalog_id]) }}">#{{ $proj->catalog->name ?? '' }}</a>
<a target="_blank" class="badge badge-pill badge-info" href="{{ wzRoute('home', ['catalog' => $proj->catalog_id]) }}">#{{ $proj->catalog->name ?? '' }}</a>
@endif
</td>
<td>{{ $proj->pages_count }}</td>
Expand Down

0 comments on commit 022b852

Please sign in to comment.