This commit is contained in:
2020-03-25 17:08:02 +08:00
parent 6b9202d341
commit 0d2ef31222
35 changed files with 1212 additions and 130 deletions
+6 -2
View File
@@ -23,9 +23,13 @@ function is_administrator() {
return true;
}
function hook() {}
function form($field = [], $data = []) {
return \app\http\form\Form::render($field, $data);
}
function widget() {}
function parse_field_bind(){
}
/**
* 获取客户端IP地址
+24
View File
@@ -8,8 +8,32 @@
// +----------------------------------------------------------------------
namespace app\controller;
use \app\model\Form;
class Front extends Base {
public function index() {
return $this->fetch();
}
public function form(){
if($this->request->isAjax()){
}else{
$id = $this->request->param('id');
$name = $this->request->param('name');
$map = [];
$map[] = ['id', '=', $id];
$info = Form::where($map)->find();
$this->data = [
'info' => $info
];
return $this->fetch();
}
}
}
+24
View File
@@ -0,0 +1,24 @@
<?php
// +----------------------------------------------------------------------
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.tensent.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
// +----------------------------------------------------------------------
namespace app\controller;
use think\facade\Session;
class Upload extends Base {
public $data = ['data' => [], 'code' => 0, 'msg' => ''];
protected function initialize() {
}
public function ueditor(){
$data = new \com\Ueditor(Session::get('userInfo.uid'));
echo $data->output();
}
}
+11 -10
View File
@@ -48,7 +48,7 @@ class Channel extends Admin {
*/
public function editable($name = null, $value = null, $pk = null) {
if ($name && ($value != null || $value != '') && $pk) {
model('Channel')->where(array('id' => $pk))->setField($name, $value);
ChannelM::where(array('id' => $pk))->update([$name => $value]);
}
}
@@ -58,10 +58,9 @@ class Channel extends Admin {
*/
public function add() {
if ($this->request->isPost()) {
$Channel = model('Channel');
$data = $this->request->post();
if ($data) {
$id = $Channel->save($data);
$id = ChannelM::save($data);
if ($id) {
return $this->success('新增成功', url('index'));
//记录行为
@@ -70,21 +69,23 @@ class Channel extends Admin {
return $this->error('新增失败');
}
} else {
$this->error($Channel->getError());
$this->error('新增失败');
}
} else {
$pid = input('pid', 0);
//获取父导航
if (!empty($pid)) {
$parent = db('Channel')->where(array('id' => $pid))->field('title')->find();
$parent = ChannelM::where(array('id' => $pid))->field('title')->find();
$this->assign('parent', $parent);
}
$pnav = db('Channel')->where(array('pid' => '0'))->select();
$this->assign('pnav', $pnav);
$this->assign('pid', $pid);
$this->assign('info', null);
$this->setMeta('新增导航');
$pnav = ChannelM::where(array('pid' => '0'))->select();
$this->data = [
'pnav' => $pnav,
'pid' => $pid,
'info' => ['pid' => $pid]
];
return $this->fetch('edit');
}
}
+29 -35
View File
@@ -10,6 +10,7 @@ namespace app\controller\admin;
use app\controller\Admin;
use app\model\Form as FormM;
use app\model\FormAttr;
/**
* @title 自定义表单
@@ -37,44 +38,40 @@ class Form extends Admin {
/**
* @title 添加表单
*/
public function add(\think\Request $request) {
public function add() {
if ($this->request->isPost()) {
$result = $this->model->validate('Form')->save($request->post());
$result = FormM::create($this->request->post());
if (false !== $result) {
return $this->success('添加成功!', url('admin/form/index'));
return $this->success('添加成功!', url('/admin/form/index'));
} else {
return $this->error($this->model->getError());
}
} else {
$data = array(
'keyList' => $this->model->addField,
$this->data = array(
'keyList' => (new FormM())->addField,
);
$this->assign($data);
$this->setMeta('添加表单');
return $this->fetch('public/edit');
return $this->fetch('admin/public/edit');
}
}
/**
* @title 编辑表单
*/
public function edit(\think\Request $request) {
public function edit() {
if ($this->request->isPost()) {
$result = $this->model->validate('Form')->save($request->post(), array('id' => $request->post('id')));
$result = FormM::update($this->request->post(), array('id' => $this->request->param('id')));
if (false !== $result) {
return $this->success('修改成功!', url('admin/form/index'));
return $this->success('修改成功!', url('/admin/form/index'));
} else {
return $this->error($this->model->getError());
}
} else {
$info = $this->model->where('id', $request->param('id'))->find();
$data = array(
$info = FormM::where('id', $this->request->param('id'))->find();
$this->data = array(
'info' => $info,
'keyList' => $this->model->editField,
'keyList' => (new FormM())->editField,
);
$this->assign($data);
$this->setMeta('编辑表单');
return $this->fetch('public/edit');
return $this->fetch('admin/public/edit');
}
}
@@ -155,17 +152,18 @@ class Form extends Admin {
* @title 表单字段
*/
public function attr($form_id = '') {
$map = array();
$map = [];
$order = "id desc";
$list = $this->Fattr->where($map)->order($order)->paginate(25);
$data = array(
$map[] = ['form_id', '=', $form_id];
$list = FormAttr::where($map)->order($order)->paginate(25);
$this->data = array(
'list' => $list,
'form_id' => $form_id,
'page' => $list->render(),
);
$this->setMeta('表单字段');
$this->assign($data);
return $this->fetch();
}
@@ -179,23 +177,18 @@ class Form extends Admin {
}
if ($this->request->isPost()) {
$data = $this->request->post();
$result = $this->Fattr->save($data);
$result = FormAttr::create($data);
if (false !== $result) {
return $this->success('添加成功!', url('admin/form/attr?form_id='.$form_id));
}else{
return $this->error($this->Fattr->getError());
}
}else{
$info = array(
'form_id' => $form_id
$this->data = array(
'info' => ['form_id' => $form_id],
'keyList' => $this->getField()
);
$data = array(
'info' => $info,
'keyList' => $this->field
);
$this->assign($data);
$this->setMeta('添加字段');
return $this->fetch('public/edit');
return $this->fetch('admin/public/edit');
}
}
@@ -247,18 +240,19 @@ class Form extends Admin {
}
protected function getField(){
$config = \think\facade\Cache::get('system_config_data');
return array(
array('name' => 'id', 'title' => 'id', 'help' => '', 'type' => 'hidden'),
array('name' => 'form_id', 'title' => 'model_id', 'help' => '', 'type' => 'hidden'),
array('name' => 'name', 'title' => '字段名', 'help' => '英文字母开头,长度不超过30', 'type' => 'text'),
array('name' => 'title', 'title' => '字段标题', 'help' => '请输入字段标题,用于表单显示', 'type' => 'text'),
array('name' => 'type', 'title' => '字段类型', 'help' => '用于表单中的展示方式', 'type' => 'select', 'option' => $this->attr, 'help' => ''),
array('name' => 'type', 'title' => '字段类型', 'help' => '用于表单中的展示方式', 'type' => 'select', 'option' => $config['config_type_list'], 'help' => ''),
array('name' => 'length', 'title' => '字段长度', 'help' => '字段的长度值', 'type' => 'text'),
array('name' => 'extra', 'title' => '参数', 'help' => '布尔、枚举、多选字段类型的定义数据', 'type' => 'textarea'),
array('name' => 'value', 'title' => '默认值', 'help' => '字段的默认值', 'type' => 'text'),
array('name' => 'remark', 'title' => '字段备注', 'help' => '用于表单中的提示', 'type' => 'text'),
array('name' => 'is_show', 'title' => '是否显示', 'help' => '是否显示在表单中', 'type' => 'select', 'option' => array('1' => '始终显示', '2' => '新增显示', '3' => '编辑显示', '0' => '不显示'), 'value' => 1),
array('name' => 'is_must', 'title' => '是否必填', 'help' => '用于自动验证', 'type' => 'select', 'option' => array('0' => '否', '1' => '是')),
array('name' => 'is_show', 'title' => '是否显示', 'help' => '是否显示在表单中', 'type' => 'select', 'option' => [['key'=>'1', 'label' => '始终显示'], ['key' => '2', 'label' => '新增显示'], ['key' => '3', 'label' => '编辑显示'], ['key' => '0', 'label' => '不显示']], 'value' => 1),
array('name' => 'is_must', 'title' => '是否必填', 'help' => '用于自动验证', 'type' => 'select', 'option' => array(['key'=>'0', 'label' => '否'], ['key'=>'1', 'label' => '是'])),
);
}
/**
+2 -2
View File
@@ -72,9 +72,9 @@ class Index extends Admin {
$clear = input('post.clear/a', array());
foreach ($clear as $key => $value) {
if ($value == 'cache') {
\think\Cache::clear(); // 清空缓存数据
\think\facade\Cache::clear(); // 清空缓存数据
} elseif ($value == 'log') {
\think\Log::clear();
\think\facade\Log::clear();
}
}
return $this->success("更新成功!", url('/admin/index/index'));
+1 -4
View File
@@ -67,12 +67,10 @@ class User extends Admin {
} else {
$info = $this->getUserinfo();
$data = array(
$this->data = array(
'info' => $info,
'keyList' => $model->editfield,
);
$this->assign($data);
$this->setMeta("编辑用户");
return $this->fetch('public/edit');
}
}
@@ -216,7 +214,6 @@ class User extends Admin {
return $this->error($user->getError());
}
} else {
$this->setMeta('修改密码');
return $this->fetch();
}
}
+42
View File
@@ -0,0 +1,42 @@
<?php
// +----------------------------------------------------------------------
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.tensent.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
// +----------------------------------------------------------------------
namespace app\http\form;
use think\facade\View;
/**
* @title 后台中间件
*/
class Factory {
protected $field = [];
protected $data = [];
public function __construct($field, $data){
$this->field = $field;
$this->data = $data;
$this->parseValue();
}
public function display($template = 'show', $data = []){
View::config([
'view_path' => dirname(__file__) . DIRECTORY_SEPARATOR . 'template' . DIRECTORY_SEPARATOR
]);
View::assign($data);
return View::fetch('/' . $template, $this->field);
}
protected function parseValue(){
$this->field['value'] = isset($this->data[$this->field['name']]) ? $this->data[$this->field['name']] : '';
}
public function show(){
return $this->display($this->field['type']);
}
}
+33
View File
@@ -0,0 +1,33 @@
<?php
// +----------------------------------------------------------------------
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.tensent.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
// +----------------------------------------------------------------------
namespace app\http\form;
use think\facade\View;
/**
* @title 后台中间件
*/
class Form {
public static function render($field, $data){
if (in_array($field['type'], ['string', 'text'])) {
$field['type'] = 'text';
}
$class = "app\\http\\form\\factory\\" . ucfirst($field['type']);
if (class_exists($class)) {
$elem = new $class($field, $data);
}else{
$elem = new \app\http\form\Factory($field, $data);
}
return $elem->show();
}
}
+26
View File
@@ -0,0 +1,26 @@
<?php
// +----------------------------------------------------------------------
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.tensent.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
// +----------------------------------------------------------------------
namespace app\http\form\factory;
use think\facade\View;
/**
* @title 后台中间件
*/
class Checkbox extends \app\http\form\Factory {
public function show(){
return $this->display('checkbox');
}
protected function parseValue(){
$this->field['value'] = isset($this->data[$this->field['name']]) ? $this->data[$this->field['name']] : [];
}
}
+22
View File
@@ -0,0 +1,22 @@
<?php
// +----------------------------------------------------------------------
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.tensent.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
// +----------------------------------------------------------------------
namespace app\http\form\factory;
use think\facade\View;
/**
* @title 后台中间件
*/
class Text extends \app\http\form\Factory {
public function show(){
return $this->display('text');
}
}
+6
View File
@@ -0,0 +1,6 @@
{volist name="option" id="item"}
<div class="checkbox-nice checkbox-inline">
<input type="checkbox" name="{$name}[]" id="{$name}-{$key}" value="{$key}" {if in_array($key, $value)}checked{/if}/>
<label for="{$name}-{$key}">{$item}</label>
</div>
{/volist}
+7
View File
@@ -0,0 +1,7 @@
<textarea name="{$name}" id="{$name}" style="width: 100%;">{$value}</textarea>
<!-- 实例化编辑器代码 -->
<script type="text/javascript">
var ue = UE.getEditor('{$name}', {
serverUrl : "{:url('/upload/ueditor')}"
});
</script>
+47
View File
@@ -0,0 +1,47 @@
<div class="picker-box">
<div id="picker_{$name}" class="picker_button">上传图片</div>
{if isset($value) && $value}
<input type="hidden" name="{$name}" id="field_{$name}" value="{$value}">
{else/}
<input type="hidden" name="{$name}" id="field_{$name}" value="">
{/if}
<div id="fileList_{$name}" class="upload-file-list-info" style="width:280px;">
{if $value}
{php}
$images = get_cover($value);
{/php}
<li class="affix-list-item" id="WU_FILE_0">
<div class="upload-file-info">
<span class="webuploader-pick-file-close" data-queued-id="WU_FILE_0" data-id="{$value}" data-fileurl="{$images['path']}"><i class="close"></i></span>
<span class="fname"></span>
<span class="fsize">上传时间:{$images['create_time']}</span>
<div class="clearfix"></div>
</div>
<div class="filebox image">
<img src="{:config('base_url')}{$images['path']}" class="img-responsive">
</div>
</li>
{/if}
</div>
</div>
<script type="text/javascript">
uploadsize = 2;
$(function(){
$("#picker_{$name}").SentUploader({
compress:false,
fileNumLimit:1,
uploadEvents: {
uploadComplete:function(file){}
},
listName : 'fileList_{$name}',
hiddenName: 'field_{$name}',
hiddenValType:1,
fileSingleSizeLimit:uploadsize*1024*1024,
closeX:true
},
{
fileType: 'service',
filename : 'images',
});
});
</script>
+5
View File
@@ -0,0 +1,5 @@
<select class="form-control" name="{$name}" id="{$name}" style="width:auto;">
{volist name="option" id="item"}
<option value="{$item['key']}" {if $item['key'] == $value}selected{/if}>{$item['label']}</option>
{/volist}
</select>
+1
View File
@@ -0,0 +1 @@
<input type="text" class="form-control" name="{$name}" id="{$name}" autocomplete="false" value="{$value}">
+1
View File
@@ -0,0 +1 @@
<textarea class="form-control" name="{$name}" id="{$name}">{$value}</textarea>
+38 -10
View File
@@ -9,6 +9,11 @@
namespace app\model;
use think\facade\Config;
use phpspirit\dbskeleton\mysql\TableModel;
use phpspirit\dbskeleton\mysql\ColumnModel;
use phpspirit\dbskeleton\Factory;
/**
* 表单
*/
@@ -22,17 +27,40 @@ class Form extends \think\Model {
'update_time' => 'integer',
);
public $addField = array(
array('name' => 'name', 'title' => '标识', 'type' => 'text', 'help' => ''),
array('name' => 'title', 'title' => '标题', 'type' => 'text', 'help' => ''),
);
public $addField = [
['name' => 'name', 'title' => '标识', 'type' => 'text', 'help' => ''],
['name' => 'title', 'title' => '标题', 'type' => 'text', 'help' => ''],
['name' => 'logo', 'title' => '显示Logo', 'type' => 'images', 'help' => ''],
['name' => 'cover', 'title' => 'banner图片', 'type' => 'images', 'help' => ''],
['name' => 'content', 'title' => '内容', 'type' => 'editor', 'help' => ''],
];
public $editField = array(
array('name' => 'id', 'title' => 'ID', 'type' => 'hidden', 'help' => ''),
array('name' => 'name', 'title' => '标识', 'type' => 'text', 'help' => ''),
array('name' => 'title', 'title' => '标题', 'type' => 'text', 'help' => ''),
array('name' => 'list_grid', 'title' => '列表定义', 'type' => 'textarea', 'help' => ''),
);
public $editField = [
['name' => 'id', 'title' => 'ID', 'type' => 'hidden', 'help' => ''],
// ['name' => 'name', 'title' => '标识', 'type' => 'text', 'help' => ''],
['name' => 'title', 'title' => '标题', 'type' => 'text', 'help' => ''],
['name' => 'logo', 'title' => '显示Logo', 'type' => 'images', 'help' => ''],
['name' => 'cover', 'title' => 'banner图片', 'type' => 'images', 'help' => ''],
['name' => 'content', 'title' => '内容', 'type' => 'editor', 'help' => ''],
['name' => 'list_grid', 'title' => '列表定义', 'type' => 'textarea', 'help' => ''],
];
public static function onAfterInsert($model){
$data = $model->getData();
$mysql = Config::get('database.connections.mysql');
$tablemodel = (new TableModel())->setCharset('utf8mb4') //设置编码
->setEngine('MyISAM') //设置引擎
->setTablename($mysql['prefix'] . 'form_' . $data['name']) //设置表名
->setComment($data['title']); //表备注
$id = (new ColumnModel())->setType('int')->setLen(11)->setName('id')->setIsPk(true)->setIncrement(true)->setComment('自增长');
$dbskeleton = Factory::instance('mysql', $mysql['hostname'] . ':' . $mysql['hostport'], $mysql['database'], $mysql['username'], $mysql['password']);
$dbskeleton->createTable($tablemodel, [$id]);
$dbskeleton->addColumn($tablemodel, (new ColumnModel())->setType('int')->setLen(11)->setName('create_time')->setIsPk(false)->setIncrement(false)->setComment('创建时间'));
$dbskeleton->addColumn($tablemodel, (new ColumnModel())->setType('int')->setLen(11)->setName('update_time')->setIsPk(false)->setIncrement(false)->setComment('更新时间'));
}
// protected static function init() {
// self::beforeInsert(function ($event) {
+57 -33
View File
@@ -6,51 +6,75 @@
// +----------------------------------------------------------------------
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
// +----------------------------------------------------------------------
namespace app\model;
use think\facade\Config;
use phpspirit\dbskeleton\mysql\TableModel;
use phpspirit\dbskeleton\mysql\ColumnModel;
use phpspirit\dbskeleton\Factory;
/**
* 设置模型
*/
class FormAttr {
class FormAttr extends \think\Model{
protected $type = array(
'id' => 'integer',
);
protected static function init() {
self::afterInsert(function ($data) {
if ($data['form_id']) {
$name = db('Form')->where('id', $data['form_id'])->value('name');
$db = new \com\Datatable();
$attr = $data->toArray();
$model_attr = array(
'form_id' => $data['form_id'],
'attr_id' => $data->id,
'group_id' => 0,
'is_add_table' => 1,
'is_show' => $data['is_show'],
'is_must' => $data['is_must'],
'sort' => 0,
);
$attr['after'] = db('FormAttr')->where('name', '<>', $data['name'])->where('form_id', $data['form_id'])->order('id desc')->value('name');
return $db->columField('form_' . strtolower($name), $attr)->query();
}
});
self::beforeUpdate(function ($data) {
$attr = $data->toArray();
$attr['action'] = 'CHANGE';
$attr['oldname'] = db('FormAttr')->where('id', $attr['id'])->value('name');
if ($attr['id']) {
$name = db('Form')->where('id', $attr['form_id'])->value('name');
$db = new \com\Datatable();
return $db->columField('form_' . strtolower($name), $attr)->query();
} else {
return false;
}
});
protected static function onAfterInsert($model){
$data = $model->getData();
$mysql = Config::get('database.connections.mysql');
$dbskeleton = Factory::instance('mysql', $mysql['hostname'] . ':' . $mysql['hostport'], $mysql['database'], $mysql['username'], $mysql['password']);
$field = (new ColumnModel())->setType('int')
->setLen($data['length'])
->setName($data['name'])
->setComment($data['title']);
$dbskeleton->addColumn($tablemodel, );
}
protected static function onBeforeUpdate($model){
$data = $model->getData();
$mysql = Config::get('database.connections.mysql');
$dbskeleton = Factory::instance('mysql', $mysql['hostname'] . ':' . $mysql['hostport'], $mysql['database'], $mysql['username'], $mysql['password']);
}
// protected static function init() {
// self::afterInsert(function ($data) {
// if ($data['form_id']) {
// $name = db('Form')->where('id', $data['form_id'])->value('name');
// $db = new \com\Datatable();
// $attr = $data->toArray();
// $model_attr = array(
// 'form_id' => $data['form_id'],
// 'attr_id' => $data->id,
// 'group_id' => 0,
// 'is_add_table' => 1,
// 'is_show' => $data['is_show'],
// 'is_must' => $data['is_must'],
// 'sort' => 0,
// );
// $attr['after'] = db('FormAttr')->where('name', '<>', $data['name'])->where('form_id', $data['form_id'])->order('id desc')->value('name');
// return $db->columField('form_' . strtolower($name), $attr)->query();
// }
// });
// self::beforeUpdate(function ($data) {
// $attr = $data->toArray();
// $attr['action'] = 'CHANGE';
// $attr['oldname'] = db('FormAttr')->where('id', $attr['id'])->value('name');
// if ($attr['id']) {
// $name = db('Form')->where('id', $attr['form_id'])->value('name');
// $db = new \com\Datatable();
// return $db->columField('form_' . strtolower($name), $attr)->query();
// } else {
// return false;
// }
// });
// }
protected function getTypeTextAttr($value, $data) {
$type = config('config_type_list');
$type_text = explode(',', $type[$data['type']]);
+1 -1
View File
@@ -45,7 +45,7 @@ class Member extends Model {
}
protected function getAccessTokenAttr($value, $data) {
$token = ['data' => ['uid' => $data['uid'], 'username' => $data['username'], 'password' => $data['password'], 'department' => $data['department']]];
$token = ['data' => ['uid' => $data['uid'], 'username' => $data['username'], 'password' => $data['password']]];
return JWTAuth::builder($token); //参数为用户认证的信息,请自行添加
}
+94
View File
@@ -0,0 +1,94 @@
/* ,使 */
{
/* */
"imageActionName": "uploadimage", /* action */
"imageFieldName": "upfile", /* */
"imageMaxSize": 2048000, /* B */
"imageAllowFiles": [".png", ".jpg", ".jpeg", ".gif", ".bmp"], /* */
"imageCompressEnable": true, /* ,true */
"imageCompressBorder": 1600, /* */
"imageInsertAlign": "none", /* */
"imageUrlPrefix": "", /* 访 */
"imagePathFormat": "./uploads/editor/image", /* , */
/* {filename} , */
/* {rand:6} , */
/* {time} */
/* {yyyy} */
/* {yy} */
/* {mm} */
/* {dd} */
/* {hh} */
/* {ii} */
/* {ss} */
/* \ : * ? " < > | */
/* 具请体看线上文档: fex.baidu.com/ueditor/#use-format_upload_filename */
/* 涂鸦图片上传配置项 */
"scrawlActionName": "uploadscrawl", /* 执行上传涂鸦的action名称 */
"scrawlFieldName": "upfile", /* 提交的图片表单名称 */
"scrawlPathFormat": "./uploads/editor/image", /* 上传保存路径,可以自定义保存路径和文件名格式 */
"scrawlMaxSize": 2048000, /* 上传大小限制,单位B */
"scrawlUrlPrefix": "", /* 图片访问路径前缀 */
"scrawlInsertAlign": "none",
/* 截图工具上传 */
"snapscreenActionName": "uploadimage", /* 执行上传截图的action名称 */
"snapscreenPathFormat": "./uploads/editor/image", /* 上传保存路径,可以自定义保存路径和文件名格式 */
"snapscreenUrlPrefix": "", /* 图片访问路径前缀 */
"snapscreenInsertAlign": "none", /* 插入的图片浮动方式 */
/* 抓取远程图片配置 */
"catcherLocalDomain": ["127.0.0.1", "localhost", "img.baidu.com"],
"catcherActionName": "catchimage", /* 执行抓取远程图片的action名称 */
"catcherFieldName": "source", /* 提交的图片列表表单名称 */
"catcherPathFormat": "./uploads/editor/image", /* 上传保存路径,可以自定义保存路径和文件名格式 */
"catcherUrlPrefix": "", /* 图片访问路径前缀 */
"catcherMaxSize": 2048000, /* 上传大小限制,单位B */
"catcherAllowFiles": [".png", ".jpg", ".jpeg", ".gif", ".bmp"], /* 抓取图片格式显示 */
/* 上传视频配置 */
"videoActionName": "uploadvideo", /* 执行上传视频的action名称 */
"videoFieldName": "upfile", /* 提交的视频表单名称 */
"videoPathFormat": "./uploads/editor/video", /* 上传保存路径,可以自定义保存路径和文件名格式 */
"videoUrlPrefix": "", /* 视频访问路径前缀 */
"videoMaxSize": 102400000, /* 上传大小限制,单位B,默认100MB */
"videoAllowFiles": [
".flv", ".swf", ".mkv", ".avi", ".rm", ".rmvb", ".mpeg", ".mpg",
".ogg", ".ogv", ".mov", ".wmv", ".mp4", ".webm", ".mp3", ".wav", ".mid"], /* 上传视频格式显示 */
/* 上传文件配置 */
"fileActionName": "uploadfile", /* controller里,执行上传视频的action名称 */
"fileFieldName": "upfile", /* 提交的文件表单名称 */
"filePathFormat": "./uploads/editor/file", /* 上传保存路径,可以自定义保存路径和文件名格式 */
"fileUrlPrefix": "", /* 文件访问路径前缀 */
"fileMaxSize": 51200000, /* 上传大小限制,单位B,默认50MB */
"fileAllowFiles": [
".png", ".jpg", ".jpeg", ".gif", ".bmp",
".flv", ".swf", ".mkv", ".avi", ".rm", ".rmvb", ".mpeg", ".mpg",
".ogg", ".ogv", ".mov", ".wmv", ".mp4", ".webm", ".mp3", ".wav", ".mid",
".rar", ".zip", ".tar", ".gz", ".7z", ".bz2", ".cab", ".iso",
".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx", ".pdf", ".txt", ".md", ".xml"
], /* 上传文件格式显示 */
/* 列出指定目录下的图片 */
"imageManagerActionName": "listimage", /* 执行图片管理的action名称 */
"imageManagerListPath": "./uploads/editor/image/", /* 指定要列出图片的目录 */
"imageManagerListSize": 20, /* 每次列出文件数量 */
"imageManagerUrlPrefix": "", /* 图片访问路径前缀 */
"imageManagerInsertAlign": "none", /* 插入的图片浮动方式 */
"imageManagerAllowFiles": [".png", ".jpg", ".jpeg", ".gif", ".bmp"], /* 列出的文件类型 */
/* 列出指定目录下的文件 */
"fileManagerActionName": "listfile", /* 执行文件管理的action名称 */
"fileManagerListPath": "./uploads/editor/file/", /* 指定要列出文件的目录 */
"fileManagerUrlPrefix": "", /* 文件访问路径前缀 */
"fileManagerListSize": 20, /* 每次列出文件数量 */
"fileManagerAllowFiles": [
".png", ".jpg", ".jpeg", ".gif", ".bmp",
".flv", ".swf", ".mkv", ".avi", ".rm", ".rmvb", ".mpeg", ".mpg",
".ogg", ".ogv", ".mov", ".wmv", ".mp4", ".webm", ".mp3", ".wav", ".mid",
".rar", ".zip", ".tar", ".gz", ".7z", ".bz2", ".cab", ".iso",
".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx", ".pdf", ".txt", ".md", ".xml"
] /* */
}