5
This commit is contained in:
@@ -1,168 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace plugin\admin\app\controller;
|
||||
|
||||
use support\Request;
|
||||
use support\Response;
|
||||
use support\think\Db;
|
||||
use taoser\facade\Validate;
|
||||
use Shopwwi\WebmanFilesystem\Facade\Storage;
|
||||
|
||||
/**
|
||||
* 附件管理
|
||||
*
|
||||
* @icon fa fa-circle-o
|
||||
*/
|
||||
class AttachController extends Crud
|
||||
{
|
||||
|
||||
/**
|
||||
* @var \app\model\Files
|
||||
*/
|
||||
protected $model = null;
|
||||
/**
|
||||
* 构造函数
|
||||
* @return void
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
$this->model = new \app\model\Files();
|
||||
}
|
||||
function list(Request $request)
|
||||
{
|
||||
return view('', [
|
||||
|
||||
]);
|
||||
}
|
||||
function feupload(Request $request): Response
|
||||
{
|
||||
$user = ['id'=>admin_id()];
|
||||
$savePath = $request->post('savePath','files');
|
||||
$validate = Validate::rule('savePath', 'alphaNum');
|
||||
$data = ['savePath' => $savePath];
|
||||
if (!$validate->check($data)) {
|
||||
return $this->fail( '参数错误:'.$validate->getError());
|
||||
}
|
||||
$savePath = trim($savePath,'/');
|
||||
$savePath = 'upload/'.$savePath.'/'.$user['id'];
|
||||
$maxSize = 1024*1024*100; //100M
|
||||
//多文件上传
|
||||
$files = $request->file();
|
||||
try {
|
||||
$result = Storage::adapter('public')
|
||||
->path($savePath)
|
||||
->size(1024*1024*10)
|
||||
->extYes(['image/jpeg','image/png'])
|
||||
->uploads($files,0,$maxSize,false);
|
||||
$save_datas = [];
|
||||
foreach($result as $k=>$fileinfo){
|
||||
$save_datas[] = [
|
||||
'user_id' => $user['id'],
|
||||
'title' => $fileinfo->origin_name,
|
||||
'path' => $fileinfo->file_name,
|
||||
'size' => $fileinfo->size,
|
||||
'mime_type' => $fileinfo->mime_type,
|
||||
'extension' => $fileinfo->extension,
|
||||
'height' => $fileinfo->file_height,
|
||||
'width' => $fileinfo->file_width,
|
||||
'sha1' => sha1_file(public_path($fileinfo->file_name)),
|
||||
'use_count' => 0,
|
||||
];
|
||||
}
|
||||
\app\model\Files::saveAll($save_datas);
|
||||
return $this->success(__('successful'),[
|
||||
'link' => $result[0]['path'],
|
||||
]);
|
||||
}catch (\Exception $e){
|
||||
return $this->fail($e->getMessage());
|
||||
}
|
||||
}
|
||||
function upload(Request $request): Response
|
||||
{
|
||||
log_alert(0);
|
||||
$savePath = $request->post('savePath','files');
|
||||
$validate = Validate::rule('savePath', 'alphaNum');
|
||||
$data = ['savePath' => $savePath];
|
||||
log_alert($data);
|
||||
if (!$validate->check($data)) {
|
||||
cp($validate->getError());
|
||||
return $this->fail( '参数错误:'.$validate->getError());
|
||||
}
|
||||
log_alert('1');
|
||||
$file = current($request->file());
|
||||
if (!$file || !$file->isValid()) {
|
||||
return $this->fail('未找到文件');
|
||||
}
|
||||
log_alert('2');
|
||||
try {
|
||||
$data = $this->base($request, $savePath);
|
||||
} catch (\Exception $e) {
|
||||
log_alert($e->getMessage());
|
||||
//throw $th;
|
||||
}
|
||||
log_alert('3');
|
||||
//cp($data);
|
||||
return $this->success( '上传成功', [
|
||||
'url' => $data['realpath'],
|
||||
'name' => $data['name'],
|
||||
'fullurl' => $data['url'],
|
||||
'size' => $data['size'],
|
||||
'url1' => $data['url'],
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取上传数据
|
||||
* @param Request $request
|
||||
* @param $savePath 保存位置
|
||||
* @return array
|
||||
* @throws \Exception
|
||||
*/
|
||||
protected function base(Request $request, $savePath): array
|
||||
{
|
||||
$user = ['id'=>admin_id()];
|
||||
// 适配器 local默认是存储在runtime目录下 public默认是存储在public目录下
|
||||
// 可访问的静态文件建议public
|
||||
// 默认适配器是local
|
||||
//Storage::adapter('public');
|
||||
$savePath = trim($savePath,'/');
|
||||
$savePath = 'upload/'.$savePath;
|
||||
cp($savePath);
|
||||
$file = current($request->file());
|
||||
cp($file);
|
||||
$mimetype = explode(',',Config('site.upload_mimetype'));
|
||||
$maxsize = Config('site.upload_maxsize')*1024*1024;
|
||||
$result = Storage::adapter('public')
|
||||
->path($savePath)
|
||||
->size($maxsize)
|
||||
->extYes($mimetype)
|
||||
->upload($file);
|
||||
cp($result);
|
||||
|
||||
$save_datas = [
|
||||
'user_id' => $user['id'],
|
||||
'category' => 'default',
|
||||
'title' => $result->origin_name,
|
||||
'path' => $result->file_name,
|
||||
'size' => $result->size,
|
||||
'mime_type' => $result->mime_type,
|
||||
'extension' => $result->extension,
|
||||
'height' => $result->file_height,
|
||||
'width' => $result->file_width,
|
||||
'sha1' => sha1_file(public_path($result->file_name)),
|
||||
'use_count' => 0,
|
||||
];
|
||||
(new \app\model\Files)->save($save_datas);
|
||||
return [
|
||||
'code' => 0,
|
||||
'url' => $result->file_url,
|
||||
'name' => $result->origin_name,
|
||||
'realpath' => '/'.$result->file_name,
|
||||
'size' => $result->size,
|
||||
'mime_type' => $result->mime_type,
|
||||
'image_with'=> $result->file_width,
|
||||
'image_height' => $result->file_height,
|
||||
'ext' => $result->extension,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace plugin\admin\app\controller;
|
||||
|
||||
use Exception;
|
||||
use support\Request;
|
||||
use support\Response;
|
||||
use support\think\Db;
|
||||
@@ -30,80 +31,38 @@ class FilesController extends Crud
|
||||
}
|
||||
function list(Request $request)
|
||||
{
|
||||
return view('', [
|
||||
$list = $this->model->paginate();
|
||||
return $this->success(__('successful'),$list);
|
||||
|
||||
}
|
||||
function felist(Request $request)
|
||||
{
|
||||
$list = $this->model->paginate();
|
||||
$result = [];
|
||||
$list->each(function($item)use(&$result){
|
||||
array_push($result,[
|
||||
'tag' => "test",
|
||||
'name' => $item["origin_name"],
|
||||
//'thumb'=> $item["file_url"],
|
||||
'url' => $item["file_url"],
|
||||
]);
|
||||
});
|
||||
return json($result);
|
||||
|
||||
]);
|
||||
}
|
||||
function feupload(Request $request): Response
|
||||
{
|
||||
$user = ['id'=>admin_id()];
|
||||
$savePath = $request->post('savePath','files');
|
||||
$validate = Validate::rule('savePath', 'alphaNum');
|
||||
$data = ['savePath' => $savePath];
|
||||
if (!$validate->check($data)) {
|
||||
return $this->fail( '参数错误:'.$validate->getError());
|
||||
}
|
||||
$savePath = trim($savePath,'/');
|
||||
$savePath = 'upload/'.$savePath.'/'.$user['id'];
|
||||
$maxSize = 1024*1024*100; //100M
|
||||
//多文件上传
|
||||
$files = $request->file();
|
||||
try {
|
||||
$result = Storage::adapter('public')
|
||||
->path($savePath)
|
||||
->size(1024*1024*10)
|
||||
->extYes(['image/jpeg','image/png'])
|
||||
->uploads($files,0,$maxSize,false);
|
||||
$save_datas = [];
|
||||
foreach($result as $k=>$fileinfo){
|
||||
$save_datas[] = [
|
||||
'user_id' => $user['id'],
|
||||
'title' => $fileinfo->origin_name,
|
||||
'path' => $fileinfo->file_name,
|
||||
'size' => $fileinfo->size,
|
||||
'mime_type' => $fileinfo->mime_type,
|
||||
'extension' => $fileinfo->extension,
|
||||
'height' => $fileinfo->file_height,
|
||||
'width' => $fileinfo->file_width,
|
||||
'sha1' => sha1_file(public_path($fileinfo->file_name)),
|
||||
'use_count' => 0,
|
||||
];
|
||||
}
|
||||
\app\model\Files::saveAll($save_datas);
|
||||
return $this->success(__('successful'),[
|
||||
'link' => $result[0]['path'],
|
||||
]);
|
||||
}catch (\Exception $e){
|
||||
return $this->fail($e->getMessage());
|
||||
}
|
||||
$data = $this->base($request, $savePath);
|
||||
return json([
|
||||
'link' => $data['file_url'],
|
||||
]);
|
||||
}
|
||||
function upload(Request $request): Response
|
||||
{
|
||||
cp('0');
|
||||
$savePath = $request->post('savePath','files');
|
||||
$validate = Validate::rule('savePath', 'alphaNum');
|
||||
$data = ['savePath' => $savePath];
|
||||
cp($data);
|
||||
if (!$validate->check($data)) {
|
||||
cp($validate->getError());
|
||||
return $this->fail( '参数错误:'.$validate->getError());
|
||||
}
|
||||
cp('1');
|
||||
$file = current($request->file());
|
||||
if (!$file || !$file->isValid()) {
|
||||
return $this->fail('未找到文件');
|
||||
}
|
||||
cp('2');
|
||||
$data = $this->base($request, $savePath);
|
||||
cp('3');
|
||||
//cp($data);
|
||||
return $this->success( '上传成功', [
|
||||
'url' => $data['realpath'],
|
||||
'name' => $data['name'],
|
||||
'fullurl' => $data['url'],
|
||||
'size' => $data['size'],
|
||||
'url1' => $data['url'],
|
||||
]);
|
||||
return $this->success( '上传成功', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -113,48 +72,47 @@ class FilesController extends Crud
|
||||
* @return array
|
||||
* @throws \Exception
|
||||
*/
|
||||
protected function base(Request $request, $savePath): array
|
||||
protected function base(Request $request, $savePath): mixed
|
||||
{
|
||||
$user = ['id'=>admin_id()];
|
||||
// 适配器 local默认是存储在runtime目录下 public默认是存储在public目录下
|
||||
// 可访问的静态文件建议public
|
||||
// 默认适配器是local
|
||||
//Storage::adapter('public');
|
||||
$validate = Validate::rule('savePath', 'alphaNum');
|
||||
$data = ['savePath' => $savePath];
|
||||
if (!$validate->check($data)) {
|
||||
throw new Exception( '参数错误:'.$validate->getError());
|
||||
}
|
||||
$savePath = trim($savePath,'/');
|
||||
$savePath = 'upload/'.$savePath;
|
||||
//$savePath = 'upload/'.$savePath;
|
||||
//$savePath = $savePath;
|
||||
$file = current($request->file());
|
||||
if (!$file || !$file->isValid()) {
|
||||
throw new Exception( '未找到文件');
|
||||
}
|
||||
$mimetype = explode(',',Config('site.upload_mimetype'));
|
||||
$maxsize = Config('site.upload_maxsize')*1024*1024;
|
||||
$result = Storage::adapter('public')
|
||||
$result = Storage::adapter('minio')
|
||||
->path($savePath)
|
||||
->size($maxsize)
|
||||
->extYes($mimetype)
|
||||
->upload($file);
|
||||
|
||||
$save_datas = [
|
||||
'user_id' => $user['id'],
|
||||
'category' => 'default',
|
||||
'title' => $result->origin_name,
|
||||
'path' => $result->file_name,
|
||||
'size' => $result->size,
|
||||
'mime_type' => $result->mime_type,
|
||||
'extension' => $result->extension,
|
||||
'height' => $result->file_height,
|
||||
'width' => $result->file_width,
|
||||
'sha1' => sha1_file(public_path($result->file_name)),
|
||||
'use_count' => 0,
|
||||
];
|
||||
(new \app\model\Files)->save($save_datas);
|
||||
return [
|
||||
'code' => 0,
|
||||
'url' => $result->file_url,
|
||||
'name' => $result->origin_name,
|
||||
'realpath' => '/'.$result->file_name,
|
||||
'size' => $result->size,
|
||||
'mime_type' => $result->mime_type,
|
||||
'image_with'=> $result->file_width,
|
||||
'image_height' => $result->file_height,
|
||||
'ext' => $result->extension,
|
||||
'admin_id' => admin_id(),
|
||||
'category' => 'default',
|
||||
'adapter' => $result->adapter,
|
||||
'origin_name' => $result->origin_name,
|
||||
'file_name' => $result->file_name,
|
||||
'size' => $result->size,
|
||||
'mime_type' => $result->mime_type,
|
||||
'extension' => $result->extension,
|
||||
'file_height' => $result->file_height,
|
||||
'file_width' => $result->file_width,
|
||||
'file_url' => $result->file_url,
|
||||
'sha1' => $result->storage_key ?:sha1_file(public_path($result->file_name)),
|
||||
'use_count' => 0,
|
||||
];
|
||||
|
||||
return \app\model\Files::create($save_datas);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,40 +103,10 @@ function refresh_admin_session(bool $force = false)
|
||||
$session->set('admin', $admin);
|
||||
}
|
||||
|
||||
function getConfig($name=''){
|
||||
if($name){
|
||||
if(strpos($name,'.')>-1){
|
||||
$name = explode('.',$name);
|
||||
if(Config('site.'.$name[0].'.type') == 'array'){
|
||||
return Config('site.'.$name[0].'.value.'.$name[1]);
|
||||
}else{
|
||||
return Config('site.'.$name[0].'.value');
|
||||
}
|
||||
}else{
|
||||
return Config('site.'.$name);
|
||||
}
|
||||
}else{
|
||||
return Config('site');
|
||||
}
|
||||
}
|
||||
function null($var='',$defaut=''){
|
||||
if(isset($var) && !$var){
|
||||
return $defaut;
|
||||
}else{
|
||||
return $var;
|
||||
}
|
||||
}
|
||||
function buildFileInput($name='',$value='',$type='image',$limit=0,$allowChoose=true){
|
||||
$tpl = '
|
||||
<input id="c-'.$name.'" class="form-control" size="50" name="'.$name.'" type="hidden" value="'.null($value).'" data-tip="头像">
|
||||
<ul class="list-inline clearfix lyear-uploads-pic" data-template="preview" id="p-'.$name.'">
|
||||
<li nodelete class="col-xs-4 col-sm-3 col-md-2">
|
||||
<a class="pic-add faupload" style="height: auto;border: 0;" id="add-pic-btn" href="#!" title="点击上传" data-input-id="c-'.$name.'" data-mimetype="'.$type.'" data-multiple="'.($limit>0 ?'true' : 'false').'" data-preview-id="p-'.$name.'"></a>';
|
||||
if($allowChoose){
|
||||
$tpl.=' <a class="pic-add fachoose" style="height: auto;border: 0;" id="choose-pic-btn" href="#!" title="选择文件" data-input-id="c-'.$name.'" data-mimetype="image/*" data-multiple="'.($limit>0 ?'true' : 'false').'" data-preview-id="p-'.$name.'"></a>';
|
||||
}
|
||||
$tpl.='
|
||||
</li>
|
||||
</ul>';
|
||||
return $tpl;
|
||||
}
|
||||
@@ -28,6 +28,7 @@ class Config implements MiddlewareInterface
|
||||
$config['action'] = $request->action_name;
|
||||
$config['moduleurl'] = admin_path();
|
||||
$config['admin_path'] = admin_path();
|
||||
$config['domain'] = env_get('server.domain','');
|
||||
$request->_view_vars = array_merge((array) $request->_view_vars,[
|
||||
'user' => session('admin'),
|
||||
'config' => $config
|
||||
|
||||
@@ -47,8 +47,8 @@
|
||||
<input id="c-avatar" class="form-control" size="50" name="avatar" type="hidden" value="{$row.avatar|null}" data-tip="头像">
|
||||
<ul class="list-inline clearfix lyear-uploads-pic" data-template="preview" id="p-avatar">
|
||||
<li nodelete class="col-xs-4 col-sm-3 col-md-2">
|
||||
<a class="pic-add faupload" style="height: auto;border: 0;" permission="app.admin.files.avatar" id="add-pic-btn" href="#!" title="点击上传" data-input-id="c-avatar" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-avatar"></a>
|
||||
<a class="pic-add fachoose" style="height: auto;border: 0;" permission="app.admin.files.list" id="choose-pic-btn" href="#!" title="选择文件" data-input-id="c-avatar" data-mimetype="image/*" data-multiple="false" data-preview-id="p-avatar"></a>
|
||||
<a class="pic-add faupload" style="height: auto;border: 0;" permission="app.admin.files.avatar" id="add-pic-btn" href="javascript:;" title="点击上传" data-input-id="c-avatar" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-avatar"></a>
|
||||
<a class="pic-add fachoose" style="height: auto;border: 0;" permission="app.admin.files.list" id="choose-pic-btn" href="javascript:;" title="选择文件" data-input-id="c-avatar" data-mimetype="image/*" data-multiple="false" data-preview-id="p-avatar"></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -65,8 +65,8 @@
|
||||
<input id="c-avatar" class="form-control" size="50" name="avatar" type="hidden" value="{$row.avatar|null}" data-tip="杀杀杀">
|
||||
<ul class="list-inline clearfix lyear-uploads-pic" data-template="preview" id="p-avatar">
|
||||
<li nodelete class="col-xs-4 col-sm-3 col-md-2">
|
||||
<a class="pic-add faupload" style="height: auto;border: 0;" permission="app.admin.files.upload" id="add-pic-btn" href="#!" title="点击上传" data-input-id="c-avatar" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-avatar"></a>
|
||||
<a class="pic-add fachoose" style="height: auto;border: 0;" permission="app.admin.files.list" id="choose-pic-btn" href="#!" title="选择文件" data-input-id="c-avatar" data-mimetype="image/*" data-multiple="false" data-preview-id="p-avatar"></a>
|
||||
<a class="pic-add faupload" style="height: auto;border: 0;" permission="app.admin.files.upload" id="add-pic-btn" href="javascript:;" title="点击上传" data-input-id="c-avatar" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-avatar"></a>
|
||||
<a class="pic-add fachoose" style="height: auto;border: 0;" permission="app.admin.files.list" id="choose-pic-btn" href="javascript:;" title="选择文件" data-input-id="c-avatar" data-mimetype="image/*" data-multiple="false" data-preview-id="p-avatar"></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -102,8 +102,8 @@
|
||||
<input id="c-image" class="form-control" size="50" name="image" type="hidden" value="{$row.image|default=''}" data-tip="image">
|
||||
<ul class="list-inline clearfix lyear-uploads-pic" data-template="preview" id="p-image">
|
||||
<li nodelete class="col-xs-4 col-sm-3 col-md-2">
|
||||
<a class="pic-add faupload" style="height: auto;border: 0;" permission="app.admin.upload.image" id="add-pic-btn" href="#!" title="点击上传" data-input-id="c-image" data-mimetype="image/*" data-multiple="false" data-preview-id="p-image"></a>
|
||||
<a class="pic-add fachoose" style="height: auto;border: 0;" permission="app.admin.files.list" id="choose-pic-btn" href="#!" title="选择文件" data-input-id="c-image" data-mimetype="image/*" data-multiple="false" data-preview-id="p-image"></a>
|
||||
<a class="pic-add faupload" style="height: auto;border: 0;" permission="app.admin.upload.image" id="add-pic-btn" href="javascript:;" title="点击上传" data-input-id="c-image" data-mimetype="image/*" data-multiple="false" data-preview-id="p-image"></a>
|
||||
<a class="pic-add fachoose" style="height: auto;border: 0;" permission="app.admin.files.list" id="choose-pic-btn" href="javascript:;" title="选择文件" data-input-id="c-image" data-mimetype="image/*" data-multiple="false" data-preview-id="p-image"></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -114,8 +114,8 @@
|
||||
<input id="c-images" class="form-control" size="50" name="images" type="hidden" value="{$row.images|default=''}" data-tip="images">
|
||||
<ul class="list-inline clearfix lyear-uploads-pic" data-template="preview" id="p-images">
|
||||
<li nodelete class="col-xs-4 col-sm-3 col-md-2">
|
||||
<a class="pic-add faupload" style="height: auto;border: 0;" permission="app.admin.upload.images" id="add-pic-btn" href="#!" title="点击上传" data-input-id="c-images" data-mimetype="image/*" data-multiple="false" data-preview-id="p-images"></a>
|
||||
<a class="pic-add fachoose" style="height: auto;border: 0;" permission="app.admin.files.list" id="choose-pic-btn" href="#!" title="选择文件" data-input-id="c-images" data-mimetype="image/*" data-multiple="false" data-preview-id="p-images"></a>
|
||||
<a class="pic-add faupload" style="height: auto;border: 0;" permission="app.admin.upload.images" id="add-pic-btn" href="javascript:;" title="点击上传" data-input-id="c-images" data-mimetype="image/*" data-multiple="false" data-preview-id="p-images"></a>
|
||||
<a class="pic-add fachoose" style="height: auto;border: 0;" permission="app.admin.files.list" id="choose-pic-btn" href="javascript:;" title="选择文件" data-input-id="c-images" data-mimetype="image/*" data-multiple="false" data-preview-id="p-images"></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -115,10 +115,7 @@
|
||||
{case value="image" break="0"}{/case}
|
||||
{case value="images"}
|
||||
<div class="form-inline">
|
||||
<!-- <input id="c-{$item.name}" class="form-control" size="50" name="{$item.name}" type="text" value="{$item.value|htmlentities}" data-tip="{$item.tip}">
|
||||
<span><button type="button" id="faupload-{$item.name}" class="btn btn-danger faupload" data-input-id="c-{$item.name}" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="{$item.type=='image'?'false':'true'}" data-preview-id="p-{$item.name}"><i class="fa fa-upload"></i>{:__('Upload')}</button></span>
|
||||
<span><button type="button" id="fachoose-{$item.name}" class="btn btn-primary fachoose" data-input-id="c-{$item.name}" data-mimetype="image/*" data-multiple="{$item.type=='image'?'false':'true'}"><i class="fa fa-list"></i> {:__('Choose')}</button></span> -->
|
||||
{html:upload name="$item.name" value="$item.value" tip="$item.tip" /}
|
||||
{html:upload name="$item.name" value="$item.value" tip="$item.tip" extend="$item.extend" /}
|
||||
</div>
|
||||
{/case}
|
||||
{case value="file" break="0"}{/case}
|
||||
|
||||
@@ -40,12 +40,12 @@
|
||||
<ul class="list-inline clearfix lyear-uploads-pic" data-template="preview" id="p-avatar">
|
||||
<li nodelete class="col-xs-4 col-sm-3 col-md-2">
|
||||
<a class="pic-add faupload" style="height: auto;border: 0;"
|
||||
permission="app.admin.files.upload" id="add-pic-btn" href="#!" title="点击上传"
|
||||
permission="app.admin.files.upload" id="add-pic-btn" href="javascript:;" title="点击上传"
|
||||
data-input-id="c-avatar"
|
||||
data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp"
|
||||
data-multiple="false" data-preview-id="p-avatar"></a>
|
||||
<a class="pic-add fachoose" style="height: auto;border: 0;"
|
||||
permission="app.admin.files.list" id="choose-pic-btn" href="#!" title="选择文件"
|
||||
permission="app.admin.files.list" id="choose-pic-btn" href="javascript:;" title="选择文件"
|
||||
data-input-id="c-avatar" data-mimetype="image/*" data-multiple="false"
|
||||
data-preview-id="p-avatar"></a>
|
||||
</li>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">文件</label>
|
||||
<div class="col-xs-12 col-sm-8 col-md-6">
|
||||
{:buildFileInput('file',$row['file'],'image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp,text/plain',0,false)}
|
||||
{html:upload name="file" value="$row['file']" tip="文件" /}
|
||||
</div>
|
||||
</div>
|
||||
{else /}
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
<input id="c-image" class="form-control" size="50" name="image" type="hidden" value="{$row.image|default=''}" data-tip="image">
|
||||
<ul class="list-inline clearfix lyear-uploads-pic" data-template="preview" id="p-image">
|
||||
<li nodelete class="col-xs-4 col-sm-3 col-md-2">
|
||||
<a class="pic-add faupload" style="height: auto;border: 0;" permission="app.admin.upload.image" id="add-pic-btn" href="#!" title="点击上传" data-input-id="c-image" data-mimetype="image/*" data-multiple="false" data-preview-id="p-image"></a>
|
||||
<a class="pic-add fachoose" style="height: auto;border: 0;display: none;" permission="app.admin.files.list" id="choose-pic-btn" href="#!" title="选择文件" data-input-id="c-image" data-mimetype="image/*" data-multiple="false" data-preview-id="p-image"></a>
|
||||
<a class="pic-add faupload" style="height: auto;border: 0;" permission="app.admin.upload.image" id="add-pic-btn" href="javascript:;" title="点击上传" data-input-id="c-image" data-mimetype="image/*" data-multiple="false" data-preview-id="p-image"></a>
|
||||
<a class="pic-add fachoose" style="height: auto;border: 0;display: none;" permission="app.admin.files.list" id="choose-pic-btn" href="javascript:;" title="选择文件" data-input-id="c-image" data-mimetype="image/*" data-multiple="false" data-preview-id="p-image"></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
<link href="__CSS__/style.min.css" rel="stylesheet" />
|
||||
<script type="text/javascript">
|
||||
var _c = {$config| json_encode=JSON_UNESCAPED_UNICODE|raw};
|
||||
window.Config = _c;
|
||||
_c['cdnurl']="";
|
||||
_c['version'] = Math.random();
|
||||
var require = {
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
<input id="c-image" class="form-control" size="50" name="image" type="hidden" value="{$row.image|default=''}" data-tip="image">
|
||||
<ul class="list-inline clearfix lyear-uploads-pic" data-template="preview" id="p-image">
|
||||
<li nodelete class="col-xs-4 col-sm-3 col-md-2">
|
||||
<a class="pic-add faupload" style="height: auto;border: 0;" permission="app.admin.upload.image" id="add-pic-btn" href="#!" title="点击上传" data-input-id="c-image" data-mimetype="image/*" data-multiple="false" data-preview-id="p-image"></a>
|
||||
<a class="pic-add fachoose" style="height: auto;border: 0;display: none;" permission="app.admin.files.list" id="choose-pic-btn" href="#!" title="选择文件" data-input-id="c-image" data-mimetype="image/*" data-multiple="false" data-preview-id="p-image"></a>
|
||||
<a class="pic-add faupload" style="height: auto;border: 0;" permission="app.admin.upload.image" id="add-pic-btn" href="javascript:;" title="点击上传" data-input-id="c-image" data-mimetype="image/*" data-multiple="false" data-preview-id="p-image"></a>
|
||||
<a class="pic-add fachoose" style="height: auto;border: 0;display: none;" permission="app.admin.files.list" id="choose-pic-btn" href="javascript:;" title="选择文件" data-input-id="c-image" data-mimetype="image/*" data-multiple="false" data-preview-id="p-image"></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -89,8 +89,8 @@
|
||||
<input id="c-avatar" class="form-control" size="50" name="avatar" type="hidden" value="{$row.avatar|default='__IMG__/user/avatar.svg'}" data-tip="头像">
|
||||
<ul class="list-inline clearfix lyear-uploads-pic" data-template="preview" id="p-avatar">
|
||||
<li nodelete class="col-xs-4 col-sm-3 col-md-2">
|
||||
<a class="pic-add faupload" style="height: auto;border: 0;" permission="app.admin.files.upload" id="add-pic-btn" href="#!" title="点击上传" data-input-id="c-avatar" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-avatar"></a>
|
||||
<a class="pic-add fachoose" style="height: auto;border: 0;" permission="app.admin.files.list" id="choose-pic-btn" href="#!" title="选择文件" data-input-id="c-avatar" data-mimetype="image/*" data-multiple="false" data-preview-id="p-avatar"></a>
|
||||
<a class="pic-add faupload" style="height: auto;border: 0;" permission="app.admin.files.upload" id="add-pic-btn" href="javascript:;" title="点击上传" data-input-id="c-avatar" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-avatar"></a>
|
||||
<a class="pic-add fachoose" style="height: auto;border: 0;" permission="app.admin.files.list" id="choose-pic-btn" href="javascript:;" title="选择文件" data-input-id="c-avatar" data-mimetype="image/*" data-multiple="false" data-preview-id="p-avatar"></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -71,8 +71,8 @@
|
||||
<input id="c-avatar" class="form-control" size="50" name="avatar" type="hidden" value="{$row.avatar|default='__IMG__/user/avatar.svg'}" data-tip="头像">
|
||||
<ul class="list-inline clearfix lyear-uploads-pic" data-template="preview" id="p-avatar">
|
||||
<li nodelete class="col-xs-4 col-sm-3 col-md-2">
|
||||
<a class="pic-add faupload" style="height: auto;border: 0;" permission="app.admin.files.upload" id="add-pic-btn" href="#!" title="点击上传" data-input-id="c-avatar" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-avatar"></a>
|
||||
<a class="pic-add fachoose" style="height: auto;border: 0;" permission="app.admin.files.list" id="choose-pic-btn" href="#!" title="选择文件" data-input-id="c-avatar" data-mimetype="image/*" data-multiple="false" data-preview-id="p-avatar"></a>
|
||||
<a class="pic-add faupload" style="height: auto;border: 0;" permission="app.admin.files.upload" id="add-pic-btn" href="javascript:;" title="点击上传" data-input-id="c-avatar" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-avatar"></a>
|
||||
<a class="pic-add fachoose" style="height: auto;border: 0;" permission="app.admin.files.list" id="choose-pic-btn" href="javascript:;" title="选择文件" data-input-id="c-avatar" data-mimetype="image/*" data-multiple="false" data-preview-id="p-avatar"></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user