Browse Source

fileupload

wesley 6 years ago
parent
commit
1b9b6406c9

+ 6 - 0
app/Http/Controllers/Admin/Base/AttachmentController.php

xqd
@@ -121,6 +121,12 @@ class AttachmentController extends Controller
         echo json_encode($return);exit;
     }
 
+    public function fileupload(){
+        $request = request()->all();
+        $data = $this->_serviceAttachment->fileUpload('file', $request, 'files');
+//        return response()->json(array('data' => $data), 200);
+        echo json_encode($data);exit;
+    }
 
     /**
      * @api {get} /api/attachment/download/{md5} 下载文件(图片)

+ 102 - 94
resources/views/admin/setting/info/index.blade.php

xqd
@@ -1,105 +1,113 @@
-@extends('admin.layout') 
+@extends('admin.layout')
 
 @section('content')
-	<div class="row">
-		<div class="col-sm-12">
-			<div class="ibox float-e-margins">
-				<div class="ibox-title">
-					<h5>基础设置</h5>
-					<div class="ibox-tools">
-						<a class="collapse-link"> <i class="fa fa-chevron-up"></i>
-						</a>
-					</div>
-				</div>
-				<div class="ibox-content">
-				    <div class="row">
-				        <form method="GET" action="" accept-charset="UTF-8">
+    <div class="row">
+        <div class="col-sm-12">
+            <div class="ibox float-e-margins">
+                <div class="ibox-title">
+                    <h5>基础设置</h5>
+                    <div class="ibox-tools">
+                        <a class="collapse-link"> <i class="fa fa-chevron-up"></i>
+                        </a>
+                    </div>
+                </div>
+                <div class="ibox-content">
+                    <div class="row">
+                        <form method="GET" action="" accept-charset="UTF-8">
 
-				        <div class="col-sm-4">
-				            <div class="input-group">
-								<input type="text" value="{{Request::get('keyword')}}"	placeholder="请输入关键词" name="keyword"class="input-sm form-control"> 
-								<span class="input-group-btn">
+                            <div class="col-sm-4">
+                                <div class="input-group">
+                                    <input type="text" value="{{Request::get('keyword')}}" placeholder="请输入关键词"
+                                           name="keyword" class="input-sm form-control">
+                                    <span class="input-group-btn">
 									<button type="submit" class="btn btn-sm btn-primary">搜索</button>
 								</span>
-    						</div>
-				        </div>
-				        </form>
-						@if(role('Setting/Info/create'))
-    					<div class="col-sm-3 pull-right">
-    					   <a href="{{ U('Setting/Info/create')}}" class="btn btn-sm btn-primary pull-right">添加</a>
-    					</div>
-						@endif
-					</div>
-					
-					<table class="table table-striped table-bordered table-hover dataTables-example dataTable">
-						<thead>
-    						<tr>
-								
-            <th class="sorting" data-sort="id"> ID </th>
-            <th class="sorting" data-sort="app_id"> 小程序appid </th>
-            <th class="sorting" data-sort="app_secret"> 小程序secret </th>
-            <th class="sorting" data-sort="mch_id"> 支付商户号 </th>
-            <th class="sorting" data-sort="api_key"> 支付密钥 </th>
-            <th class="sorting" data-sort="cert_path"> 支付cart路径 </th>
-            <th class="sorting" data-sort="key_path"> 支付key路径 </th>
-        						<th width="22%">相关操作</th>
-        					</tr>
-						</thead>
-						<tbody>
-						@if(isset($list))
-							@foreach($list as $key => $item)							<tr>
-								
-            <td>{{ $item->id }}</td>
-            <td>{{ $item->app_id }}</td>
-            <td>{{ $item->app_secret }}</td>
-            <td>{{ $item->mch_id }}</td>
-            <td>{{ $item->api_key }}</td>
-            <td>{{ $item->cert_path }}</td>
-            <td>{{ $item->key_path }}</td>
-								<td>
-									<div class="btn-group">
-										<button data-toggle="dropdown"
-											class="btn btn-warning btn-sm dropdown-toggle"
-											aria-expanded="false">
-											操作 <span class="caret"></span>
-										</button>
-										<ul class="dropdown-menu">
+                                </div>
+                            </div>
+                        </form>
+                        @if(role('Setting/Info/create'))
+                            <div class="col-sm-3 pull-right">
+                                <a href="{{ U('Setting/Info/create')}}" class="btn btn-sm btn-primary pull-right">添加</a>
+                            </div>
+                        @endif
+                    </div>
 
+                    <table class="table table-striped table-bordered table-hover dataTables-example dataTable">
+                        <thead>
+                        <tr>
 
-											@if(role('Setting/Info/update'))
-											<li><a href="{{ U('Setting/Info/update',['id'=>$item->id])}}" class="font-bold">修改</a></li>
-											@endif
+                            <th class="sorting" data-sort="id"> ID</th>
+                            <th class="sorting" data-sort="app_id"> 小程序appid</th>
+                            <th class="sorting" data-sort="app_secret"> 小程序secret</th>
+                            <th class="sorting" data-sort="mch_id"> 支付商户号</th>
+                            <th class="sorting" data-sort="api_key"> 支付密钥</th>
+                            <th class="sorting" data-sort="cert_path"> 支付cart路径</th>
+                            <th class="sorting" data-sort="key_path"> 支付key路径</th>
+                            <th width="22%">相关操作</th>
+                        </tr>
+                        </thead>
+                        <tbody>
+                        @if(isset($list))
+                            @foreach($list as $key => $item)
+                                <tr>
 
-											@if(role('Setting/Info/destroy'))
-											<li class="divider"></li>
-											<li><a href="{{ U('Setting/Info/destroy',['id'=>$item->id])}}" onclick="return confirm('你确定执行删除操作?');">删除</a></li>
-											@endif
+                                    <td>{{ $item->id }}</td>
+                                    <td>{{ $item->app_id }}</td>
+                                    <td>{{ $item->app_secret }}</td>
+                                    <td>{{ $item->mch_id }}</td>
+                                    <td>{{ $item->api_key }}</td>
+                                    <td>{{ $item->cert_path }}</td>
+                                    <td>{{ $item->key_path }}</td>
+                                    <td>
+                                        <div class="btn-group">
+                                            <button data-toggle="dropdown"
+                                                    class="btn btn-warning btn-sm dropdown-toggle"
+                                                    aria-expanded="false">
+                                                操作 <span class="caret"></span>
+                                            </button>
+                                            <ul class="dropdown-menu">
 
-										</ul>
-									</div>
-								@if(role('Setting/Info/view'))
-										<button onclick="layer.open({type: 2,area: ['80%', '90%'],content: '{{ U('Setting/Info/view',['id'=>$item->id])}}'});"  class="btn btn-primary ">查看</button>
-									@endif
-								</td>
-							</tr>
-							@endforeach
-							@endif
 
-						</tbody>
-					</table>
-					<div class="row">
-						<div class="col-sm-6">
-							<div class="dataTables_info" id="DataTables_Table_0_info"
-								role="alert" aria-live="polite" aria-relevant="all">每页{{ $list->count() }}条,共{{ $list->lastPage() }}页,总{{ $list->total() }}条。</div>
-						</div>
-						<div class="col-sm-6">
-						<div class="dataTables_paginate paging_simple_numbers" id="DataTables_Table_0_paginate">
-						{!! $list->setPath('')->appends(Request::all())->render() !!}
-						</div>
-						</div>
-					</div>
-				</div>
-			</div>
-		</div>
-	</div>
+                                                @if(role('Setting/Info/update'))
+                                                    <li><a href="{{ U('Setting/Info/update',['id'=>$item->id])}}"
+                                                           class="font-bold">修改</a></li>
+                                                @endif
+
+                                                @if(role('Setting/Info/destroy'))
+                                                    <li class="divider"></li>
+                                                    <li><a href="{{ U('Setting/Info/destroy',['id'=>$item->id])}}"
+                                                           onclick="return confirm('你确定执行删除操作?');">删除</a></li>
+                                                @endif
+
+                                            </ul>
+                                        </div>
+                                        @if(role('Setting/Info/view'))
+                                            <button onclick="layer.open({type: 2,area: ['80%', '90%'],content: '{{ U('Setting/Info/view',['id'=>$item->id])}}'});"
+                                                    class="btn btn-primary ">查看
+                                            </button>
+                                        @endif
+                                    </td>
+                                </tr>
+                            @endforeach
+                        @endif
+
+                        </tbody>
+                    </table>
+                    <div class="row">
+                        <div class="col-sm-6">
+                            <div class="dataTables_info" id="DataTables_Table_0_info"
+                                 role="alert" aria-live="polite" aria-relevant="all">每页{{ $list->count() }}
+                                条,共{{ $list->lastPage() }}页,总{{ $list->total() }}条。
+                            </div>
+                        </div>
+                        <div class="col-sm-6">
+                            <div class="dataTables_paginate paging_simple_numbers" id="DataTables_Table_0_paginate">
+                                {!! $list->setPath('')->appends(Request::all())->render() !!}
+                            </div>
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
 @endsection