|
@@ -7,8 +7,19 @@
|
|
|
<meta name="description" content="">
|
|
<meta name="description" content="">
|
|
|
<meta name="author" content="FastAdmin">
|
|
<meta name="author" content="FastAdmin">
|
|
|
<title>FastAdmin</title>
|
|
<title>FastAdmin</title>
|
|
|
- <link href="https://cdn.bootcss.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
|
|
|
|
|
- <link href="https://cdn.bootcss.com/font-awesome/4.6.2/css/font-awesome.min.css" rel="stylesheet">
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <!-- Bootstrap Core CSS -->
|
|
|
|
|
+ <link href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
|
|
|
+
|
|
|
|
|
+ <!-- Plugin CSS -->
|
|
|
|
|
+ <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet">
|
|
|
|
|
+
|
|
|
|
|
+ <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
|
|
|
|
+ <!--[if lt IE 9]>
|
|
|
|
|
+ <script src="https://cdn.jsdelivr.net/npm/html5shiv@3.7.3/dist/html5shiv.min.js"></script>
|
|
|
|
|
+ <script src="https://cdn.jsdelivr.net/npm/respond.js@1.4.2/dest/respond.min.js"></script>
|
|
|
|
|
+ <![endif]-->
|
|
|
|
|
+
|
|
|
<style type="text/css">
|
|
<style type="text/css">
|
|
|
body {
|
|
body {
|
|
|
padding-top: 70px; margin-bottom: 15px;
|
|
padding-top: 70px; margin-bottom: 15px;
|
|
@@ -317,7 +328,7 @@
|
|
|
<div class="panel panel-default">
|
|
<div class="panel panel-default">
|
|
|
<div class="panel-heading" id="heading-1">
|
|
<div class="panel-heading" id="heading-1">
|
|
|
<h4 class="panel-title">
|
|
<h4 class="panel-title">
|
|
|
- <span class="label label-success">GET</span>
|
|
|
|
|
|
|
+ <span class="label label-primary">POST</span>
|
|
|
<a data-toggle="collapse" data-parent="#accordion1" href="#collapseOne1"> 上传文件 <span class="text-muted">/api/common/upload</span></a>
|
|
<a data-toggle="collapse" data-parent="#accordion1" href="#collapseOne1"> 上传文件 <span class="text-muted">/api/common/upload</span></a>
|
|
|
</h4>
|
|
</h4>
|
|
|
</div>
|
|
</div>
|
|
@@ -379,7 +390,7 @@
|
|
|
<div class="panel panel-default">
|
|
<div class="panel panel-default">
|
|
|
<div class="panel-heading"><strong>参数</strong></div>
|
|
<div class="panel-heading"><strong>参数</strong></div>
|
|
|
<div class="panel-body">
|
|
<div class="panel-body">
|
|
|
- <form enctype="application/x-www-form-urlencoded" role="form" action="/api/common/upload" method="get" name="form1" id="form1">
|
|
|
|
|
|
|
+ <form enctype="application/x-www-form-urlencoded" role="form" action="/api/common/upload" method="POST" name="form1" id="form1">
|
|
|
<div class="form-group">
|
|
<div class="form-group">
|
|
|
<label class="control-label" for="file">file</label>
|
|
<label class="control-label" for="file">file</label>
|
|
|
<input type="File" class="form-control input-sm" id="file" required placeholder="文件流" name="file">
|
|
<input type="File" class="form-control input-sm" id="file" required placeholder="文件流" name="file">
|
|
@@ -3716,7 +3727,7 @@
|
|
|
|
|
|
|
|
<div class="row mt0 footer">
|
|
<div class="row mt0 footer">
|
|
|
<div class="col-md-6" align="left">
|
|
<div class="col-md-6" align="left">
|
|
|
- Generated on 2018-08-04 20:31:01 </div>
|
|
|
|
|
|
|
+ Generated on 2018-10-19 17:00:36 </div>
|
|
|
<div class="col-md-6" align="right">
|
|
<div class="col-md-6" align="right">
|
|
|
<a href="https://www.fastadmin.net" target="_blank">FastAdmin</a>
|
|
<a href="https://www.fastadmin.net" target="_blank">FastAdmin</a>
|
|
|
</div>
|
|
</div>
|
|
@@ -3724,8 +3735,12 @@
|
|
|
|
|
|
|
|
</div> <!-- /container -->
|
|
</div> <!-- /container -->
|
|
|
|
|
|
|
|
- <script src="https://cdn.bootcss.com/jquery/1.10.2/jquery.min.js"></script>
|
|
|
|
|
- <script src="https://cdn.bootcss.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
|
|
|
|
|
|
|
+ <!-- jQuery -->
|
|
|
|
|
+ <script src="https://cdn.jsdelivr.net/npm/jquery@2.1.4/dist/jquery.min.js"></script>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- Bootstrap Core JavaScript -->
|
|
|
|
|
+ <script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js"></script>
|
|
|
|
|
+
|
|
|
<script type="text/javascript">
|
|
<script type="text/javascript">
|
|
|
function syntaxHighlight(json) {
|
|
function syntaxHighlight(json) {
|
|
|
if (typeof json != 'string') {
|
|
if (typeof json != 'string') {
|
|
@@ -3858,12 +3873,14 @@
|
|
|
//keep a copy of action attribute in order to modify the copy
|
|
//keep a copy of action attribute in order to modify the copy
|
|
|
//instead of the initial attribute
|
|
//instead of the initial attribute
|
|
|
var url = $(form).attr('action');
|
|
var url = $(form).attr('action');
|
|
|
|
|
+ var method = $(form).prop('method').toLowerCase() || 'get';
|
|
|
|
|
|
|
|
var formData = new FormData();
|
|
var formData = new FormData();
|
|
|
|
|
|
|
|
$(form).find('input').each(function (i, input) {
|
|
$(form).find('input').each(function (i, input) {
|
|
|
- if ($(input).attr('type') == 'file') {
|
|
|
|
|
|
|
+ if ($(input).attr('type').toLowerCase() == 'file') {
|
|
|
formData.append($(input).attr('name'), $(input)[0].files[0]);
|
|
formData.append($(input).attr('name'), $(input)[0].files[0]);
|
|
|
|
|
+ method = 'post';
|
|
|
} else {
|
|
} else {
|
|
|
formData.append($(input).attr('name'), $(input).val())
|
|
formData.append($(input).attr('name'), $(input).val())
|
|
|
}
|
|
}
|
|
@@ -3906,8 +3923,8 @@
|
|
|
|
|
|
|
|
$.ajax({
|
|
$.ajax({
|
|
|
url: $('#apiUrl').val() + url,
|
|
url: $('#apiUrl').val() + url,
|
|
|
- data: $(form).prop('method').toLowerCase() == 'get' ? $(form).serialize() : formData,
|
|
|
|
|
- type: $(form).prop('method') + '',
|
|
|
|
|
|
|
+ data: method == 'get' ? $(form).serialize() : formData,
|
|
|
|
|
+ type: method,
|
|
|
dataType: 'json',
|
|
dataType: 'json',
|
|
|
contentType: false,
|
|
contentType: false,
|
|
|
processData: false,
|
|
processData: false,
|