mirror of https://gitee.com/karson/fastadmin.git
parent
ac97988661
commit
3f4e54d0dd
|
|
@ -77,7 +77,7 @@
|
|||
<div class="widget-body no-padding">
|
||||
<div id="toolbar" class="toolbar">
|
||||
{:build_toolbar('refresh')}
|
||||
<button type="button" id="faupload-addon" class="btn btn-danger faupload" data-url="addon/local" data-mimetype="application/zip" data-multiple="false"><i class="fa fa-upload"></i>
|
||||
<button type="button" id="faupload-addon" class="btn btn-danger faupload" data-url="addon/local" data-mimetype="zip" data-multiple="false"><i class="fa fa-upload"></i>
|
||||
{:__('Offline install')}
|
||||
</button>
|
||||
{if $Think.config.fastadmin.api_url}
|
||||
|
|
|
|||
|
|
@ -51,9 +51,9 @@
|
|||
<div class="box-body box-profile">
|
||||
|
||||
<div class="profile-avatar-container">
|
||||
<img class="profile-user-img img-responsive img-circle faupload" src="{$admin.avatar|cdnurl|htmlentities}" alt="">
|
||||
<img class="profile-user-img img-responsive img-circle" src="{$admin.avatar|cdnurl|htmlentities}" alt="">
|
||||
<div class="profile-avatar-text img-circle">{:__('Click to edit')}</div>
|
||||
<button id="faupload-avatar" class="faupload" data-input-id="c-avatar"><i class="fa fa-upload"></i> {:__('Upload')}</button>
|
||||
<button type="button" id="faupload-avatar" class="faupload" data-input-id="c-avatar"><i class="fa fa-upload"></i> {:__('Upload')}</button>
|
||||
</div>
|
||||
|
||||
<h3 class="profile-username text-center">{$admin.username|htmlentities}</h3>
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ class Common extends Api
|
|||
} catch (UploadException $e) {
|
||||
$this->error($e->getMessage());
|
||||
}
|
||||
$this->success(__('Uploaded successful'), '', ['url' => $attachment->url]);
|
||||
$this->success(__('Uploaded successful'), ['url' => $attachment->url]);
|
||||
} elseif ($method == 'clean') {
|
||||
//删除冗余的分片文件
|
||||
try {
|
||||
|
|
@ -102,7 +102,7 @@ class Common extends Api
|
|||
$this->error($e->getMessage());
|
||||
}
|
||||
|
||||
$this->success(__('Uploaded successful'), '', ['url' => $attachment->url]);
|
||||
$this->success(__('Uploaded successful'), ['url' => $attachment->url]);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ define(['jquery', 'bootstrap', 'frontend', 'form', 'template'], function ($, und
|
|||
$("#faupload-avatar").data("upload-success", function (data) {
|
||||
var url = Fast.api.cdnurl(data.url);
|
||||
$(".profile-user-img").prop("src", url);
|
||||
Toastr.success(__('Upload successful'));
|
||||
Toastr.success(__('Uploaded successful'));
|
||||
});
|
||||
Form.api.bindevent($("#profile-form"));
|
||||
$(document).on("click", ".btn-change", function () {
|
||||
|
|
|
|||
|
|
@ -7387,7 +7387,7 @@ define('upload',['jquery', 'bootstrap', 'dropzone', 'template'], function ($, un
|
|||
}
|
||||
$(this).attr("initialized", true);
|
||||
var that = this;
|
||||
var id = $(this).prop("id");
|
||||
var id = $(this).prop("id") || $(this).prop("name") || Dropzone.uuidv4();
|
||||
var url = $(this).data("url");
|
||||
var maxsize = $(this).data("maxsize");
|
||||
var maxcount = $(this).data("maxcount");
|
||||
|
|
@ -7431,12 +7431,12 @@ define('upload',['jquery', 'bootstrap', 'dropzone', 'template'], function ($, un
|
|||
return bytes / Math.pow(1024, 2);
|
||||
}(maxsize));
|
||||
|
||||
var options = $("#" + id).data() || {};
|
||||
var options = $(this).data() || {};
|
||||
delete options.success;
|
||||
delete options.url;
|
||||
multipart = $.isArray(multipart) ? {} : multipart;
|
||||
|
||||
Upload.list[id] = new Dropzone("#" + id, $.extend({
|
||||
Upload.list[id] = new Dropzone(this, $.extend({
|
||||
url: url,
|
||||
params: function (files, xhr, chunk) {
|
||||
var params = multipart;
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ define(['jquery', 'bootstrap', 'dropzone', 'template'], function ($, undefined,
|
|||
}
|
||||
$(this).attr("initialized", true);
|
||||
var that = this;
|
||||
var id = $(this).prop("id");
|
||||
var id = $(this).prop("id") || $(this).prop("name") || Dropzone.uuidv4();
|
||||
var url = $(this).data("url");
|
||||
var maxsize = $(this).data("maxsize");
|
||||
var maxcount = $(this).data("maxcount");
|
||||
|
|
@ -169,12 +169,12 @@ define(['jquery', 'bootstrap', 'dropzone', 'template'], function ($, undefined,
|
|||
return bytes / Math.pow(1024, 2);
|
||||
}(maxsize));
|
||||
|
||||
var options = $("#" + id).data() || {};
|
||||
var options = $(this).data() || {};
|
||||
delete options.success;
|
||||
delete options.url;
|
||||
multipart = $.isArray(multipart) ? {} : multipart;
|
||||
|
||||
Upload.list[id] = new Dropzone("#" + id, $.extend({
|
||||
Upload.list[id] = new Dropzone(this, $.extend({
|
||||
url: url,
|
||||
params: function (files, xhr, chunk) {
|
||||
var params = multipart;
|
||||
|
|
|
|||
Loading…
Reference in New Issue