1、后台编辑器图片上传问题解决
2、文件代码格式化
This commit is contained in:
@@ -66,20 +66,20 @@
|
|||||||
<td>
|
<td>
|
||||||
{if isset($item['is_top'])}
|
{if isset($item['is_top'])}
|
||||||
{if $item['is_top']}
|
{if $item['is_top']}
|
||||||
<a href="{:url('admin/content/settop',array('model_id'=>$model_id,'id'=>$item['id'],'is_top'=>'0'))}" class="ajax-get">取消置顶</a>
|
<a href="{:url('admin/content/settop?model_id='.$model_id,array('id'=>$item['id'],'is_top'=>'0'))}" class="ajax-get">取消置顶</a>
|
||||||
{else/}
|
{else/}
|
||||||
<a href="{:url('admin/content/settop',array('model_id'=>$model_id,'id'=>$item['id'],'is_top'=>'1'))}" class="ajax-get">置顶</a>
|
<a href="{:url('admin/content/settop?model_id='.$model_id,array('id'=>$item['id'],'is_top'=>'1'))}" class="ajax-get">置顶</a>
|
||||||
{/if}
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
{if isset($item['status'])}
|
{if isset($item['status'])}
|
||||||
{if $item['status']}
|
{if $item['status']}
|
||||||
<a href="{:url('admin/content/status',array('model_id'=>$model_id,'id'=>$item['id'],'status'=>'0'))}" class="ajax-get">取消审核</a>
|
<a href="{:url('admin/content/status?model_id='.$model_id,array('id'=>$item['id'],'status'=>'0'))}" class="ajax-get">取消审核</a>
|
||||||
{else/}
|
{else/}
|
||||||
<a href="{:url('admin/content/status',array('model_id'=>$model_id,'id'=>$item['id'],'status'=>'1'))}" class="ajax-get">审核</a>
|
<a href="{:url('admin/content/status?model_id='.$model_id,array('id'=>$item['id'],'status'=>'1'))}" class="ajax-get">审核</a>
|
||||||
{/if}
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
<a href="{:url('admin/content/edit',array('model_id'=>$model_id, 'id'=>$item['id']))}" >编辑</a>
|
<a href="{:url('admin/content/edit?model_id='.$model_id,array('id'=>$item['id']))}" >编辑</a>
|
||||||
<a href="{:url('admin/content/del',array('model_id'=>$model_id, 'id'=>$item['id']))}" class="ajax-get confirm">删除</a>
|
<a href="{:url('admin/content/del?model_id='.$model_id,array('id'=>$item['id']))}" class="ajax-get confirm">删除</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{/volist}
|
{/volist}
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ class InitHook {
|
|||||||
$route["user/" . $value['name'] . "/del"] = "user/content/del?model_id=" . $value['id'];
|
$route["user/" . $value['name'] . "/del"] = "user/content/del?model_id=" . $value['id'];
|
||||||
$route["user/" . $value['name'] . "/status"] = "user/content/status?model_id=" . $value['id'];
|
$route["user/" . $value['name'] . "/status"] = "user/content/status?model_id=" . $value['id'];
|
||||||
}
|
}
|
||||||
$route["list/:id"] = "index/content/category";
|
$route["list/:id"] = "index/content/category";
|
||||||
\think\Route::rule($route);
|
\think\Route::rule($route);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -61,17 +61,30 @@ class Upload {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function editor() {
|
public function editor() {
|
||||||
|
$callback = request()->get('callback');
|
||||||
$file = request()->file('upfile');
|
$file = request()->file('upfile');
|
||||||
$info = $file->move(config('editor_upload.rootPath'), true, false);
|
$info = $file->move(config('editor_upload.rootPath'), true, false);
|
||||||
if ($info) {
|
if ($info) {
|
||||||
$data = $this->parseFile($info);
|
$fileInfo = $this->parseFile($info);
|
||||||
$data['success'] = true;
|
$data = array(
|
||||||
$data['file_path'] = $data['url'];
|
"originalName" => $fileInfo['name'],
|
||||||
|
"name" => $fileInfo['name'],
|
||||||
|
"url" => $fileInfo['url'],
|
||||||
|
"size" => $fileInfo['size'],
|
||||||
|
"type" => $fileInfo['ext'],
|
||||||
|
"state" => 'SUCCESS'
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
$data['success'] = false;
|
$data['state'] = $file->getError();
|
||||||
$data['msg'] = "error message";
|
}
|
||||||
|
/**
|
||||||
|
* 返回数据
|
||||||
|
*/
|
||||||
|
if($callback) {
|
||||||
|
return '<script>'.$callback.'('.json_encode($data).')</script>';
|
||||||
|
} else {
|
||||||
|
return json_encode($data);
|
||||||
}
|
}
|
||||||
return $data;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function delete() {
|
public function delete() {
|
||||||
|
|||||||
@@ -10,10 +10,10 @@
|
|||||||
namespace app\index\controller;
|
namespace app\index\controller;
|
||||||
use app\common\controller\Fornt;
|
use app\common\controller\Fornt;
|
||||||
|
|
||||||
class Index extends Fornt{
|
class Index extends Fornt {
|
||||||
|
|
||||||
//网站首页
|
//网站首页
|
||||||
public function index(){
|
public function index() {
|
||||||
//设置SEO
|
//设置SEO
|
||||||
$this->setSeo(config('web_site_title'), config('web_site_keyword'), config('web_site_description'));
|
$this->setSeo(config('web_site_title'), config('web_site_keyword'), config('web_site_description'));
|
||||||
return $this->fetch();
|
return $this->fetch();
|
||||||
|
|||||||
@@ -8,34 +8,30 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
'__pattern__' => array(
|
'__pattern__' => array(
|
||||||
'name' => '\w+',
|
'name' => '\w+',
|
||||||
),
|
),
|
||||||
|
|
||||||
'/' => 'index/index/index', // 首页访问路由
|
'/' => 'index/index/index', // 首页访问路由
|
||||||
'search' => 'index/search/index', // 首页访问路由
|
'search' => 'index/search/index', // 首页访问路由
|
||||||
|
|
||||||
'cart/index' => 'index/cart/index',
|
'cart/index' => 'index/cart/index',
|
||||||
'cart/add' => 'index/cart/add',
|
'cart/add' => 'index/cart/add',
|
||||||
'cart/count' => 'index/cart/count',
|
'cart/count' => 'index/cart/count',
|
||||||
|
|
||||||
'login' => 'user/login/index',
|
'login' => 'user/login/index',
|
||||||
'register' => 'user/login/register',
|
'register' => 'user/login/register',
|
||||||
'logout' => 'user/login/logout',
|
'logout' => 'user/login/logout',
|
||||||
'uc' => 'user/index/index',
|
'uc' => 'user/index/index',
|
||||||
|
|
||||||
'order/index' => 'user/order/index',
|
'order/index' => 'user/order/index',
|
||||||
'order/list' => 'user/order/lists',
|
'order/list' => 'user/order/lists',
|
||||||
|
|
||||||
'admin/login' => 'admin/index/login',
|
'admin/login' => 'admin/index/login',
|
||||||
'admin/logout' => 'admin/index/logout',
|
'admin/logout' => 'admin/index/logout',
|
||||||
|
|
||||||
// 变量传入index模块的控制器和操作方法
|
// 变量传入index模块的控制器和操作方法
|
||||||
'addons/:mc/:ac' => 'index/addons/execute', // 静态地址和动态地址结合
|
'addons/:mc/:ac' => 'index/addons/execute', // 静态地址和动态地址结合
|
||||||
'usera/:mc/:ac' => 'user/addons/execute', // 静态地址和动态地址结合
|
'usera/:mc/:ac' => 'user/addons/execute', // 静态地址和动态地址结合
|
||||||
'admina/:mc/:ac' => 'admin/addons/execute', // 静态地址和动态地址结合
|
'admina/:mc/:ac' => 'admin/addons/execute', // 静态地址和动态地址结合
|
||||||
|
|
||||||
'book/list' => 'index/book/index',
|
|
||||||
'book/search' => 'index/book/search',
|
|
||||||
'book/detail/:id' => 'index/book/detail',
|
|
||||||
);
|
);
|
||||||
@@ -137,7 +137,7 @@
|
|||||||
|
|
||||||
//图片上传配置区
|
//图片上传配置区
|
||||||
,imageUrl: "imageUp.php" //图片上传提交地址
|
,imageUrl: "imageUp.php" //图片上传提交地址
|
||||||
,imagePath: "php/" //图片修正地址,引用了fixedImagePath,如有特殊需求,可自行配置
|
,imagePath: "" //图片修正地址,引用了fixedImagePath,如有特殊需求,可自行配置
|
||||||
,imageFieldName: "upfile" //图片数据的key,若此处修改,需要在后台对应文件修改对应参数
|
,imageFieldName: "upfile" //图片数据的key,若此处修改,需要在后台对应文件修改对应参数
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user