mirror of https://github.com/1099438829/apeblog
修正文件上传和一些bug
This commit is contained in:
parent
80e209d04e
commit
73505e1431
|
|
@ -32,7 +32,6 @@ class Article extends AuthController
|
|||
|
||||
/**
|
||||
* 文章列表
|
||||
* @param Request $request
|
||||
* @return mixed
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
|
|
@ -40,7 +39,7 @@ class Article extends AuthController
|
|||
* @author 李玉坤
|
||||
* @date 2021-02-15 23:26
|
||||
*/
|
||||
public function lst(Request $request)
|
||||
public function lst()
|
||||
{
|
||||
$where = Util::postMore([
|
||||
['name',''],
|
||||
|
|
@ -89,9 +88,12 @@ class Article extends AuthController
|
|||
try {
|
||||
$data['author'] = $data['author']?:$this->adminInfo['nickname'];
|
||||
$data['uid'] = $this->adminId;
|
||||
$content = '';
|
||||
if (!empty($data['content'])){
|
||||
$content = $data['content'];
|
||||
}
|
||||
//判断摘要是否为空,为空则从内容摘取
|
||||
$data['abstract'] = $data['abstract']?:mb_substr($content,0,100);
|
||||
unset($data['content']);
|
||||
if ($data['is_recommend']) $data['is_recommend'] = 1;
|
||||
if ($data['is_hot']) $data['is_hot'] = 1;
|
||||
|
|
@ -191,7 +193,7 @@ class Article extends AuthController
|
|||
* @author 李玉坤
|
||||
* @date 2021-02-20 17:00
|
||||
*/
|
||||
public function edit(Request $request)
|
||||
public function edit()
|
||||
{
|
||||
$where = Util::postMore([
|
||||
['name',''],
|
||||
|
|
@ -219,7 +221,7 @@ class Article extends AuthController
|
|||
* @return string
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function comment($article_id ='')
|
||||
public function comment()
|
||||
{
|
||||
return $this->fetch();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,11 +53,10 @@ class FriendLink extends AuthController
|
|||
|
||||
/**
|
||||
* 添加友链
|
||||
* @param Request $request
|
||||
* @return string
|
||||
* @throws \FormBuilder\Exception\FormBuilderException
|
||||
*/
|
||||
public function add(Request $request)
|
||||
public function add()
|
||||
{
|
||||
$form = array();
|
||||
$form[] = Elm::input('title','链接名称')->col(10);
|
||||
|
|
|
|||
|
|
@ -7,9 +7,7 @@ use app\common\model\Attachment;
|
|||
use app\common\model\AttachmentCategory;
|
||||
use FormBuilder\Factory\Elm;
|
||||
use app\admin\service\FormBuilderService as Form;
|
||||
use app\admin\service\storage\QcloudCoService;
|
||||
use app\admin\service\UtilService as Util;
|
||||
use app\common\utils\Json;
|
||||
|
||||
/**
|
||||
* Class Images
|
||||
|
|
@ -68,6 +66,7 @@ class Images extends AuthController
|
|||
* @param $id
|
||||
* @return string
|
||||
* @throws \FormBuilder\Exception\FormBuilderException
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function editCategory($id=0,$pid=0)
|
||||
{
|
||||
|
|
@ -90,7 +89,7 @@ class Images extends AuthController
|
|||
/**
|
||||
* 保存目录
|
||||
* @param string $id
|
||||
* @return json
|
||||
* @return mixed
|
||||
*/
|
||||
public function saveCategory($id="")
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
namespace app\admin\controller;
|
||||
use app\BaseController;
|
||||
use Exception;
|
||||
|
||||
|
||||
class SystemBasic extends BaseController
|
||||
|
|
@ -14,11 +15,11 @@ class SystemBasic extends BaseController
|
|||
/**
|
||||
* 操作失败提示框
|
||||
* @param string $msg 提示信息
|
||||
* @param string $backUrl 跳转地址
|
||||
* @param string $title 标题
|
||||
* @param int $backUrl 跳转地址
|
||||
* @param string $info
|
||||
* @param int $duration 持续时间
|
||||
* @return mixed
|
||||
* @throws \Exception
|
||||
* @throws Exception
|
||||
*/
|
||||
protected function failedNotice($msg = '操作失败', $backUrl = 0, $info = '', $duration = 3)
|
||||
{
|
||||
|
|
@ -33,7 +34,7 @@ class SystemBasic extends BaseController
|
|||
* @param int $backUrl
|
||||
* @param string $title
|
||||
* @return mixed
|
||||
* @throws \Exception
|
||||
* @throws Exception
|
||||
*/
|
||||
protected function failedNoticeLast($msg = '操作失败', $backUrl = 0, $info = '')
|
||||
{
|
||||
|
|
@ -47,7 +48,7 @@ class SystemBasic extends BaseController
|
|||
* @param string $title 标题
|
||||
* @param int $duration 持续时间
|
||||
* @return mixed
|
||||
* @throws \Exception
|
||||
* @throws Exception
|
||||
*/
|
||||
protected function successfulNotice($msg = '操作成功',$backUrl = 0,$info = '',$duration = 3)
|
||||
{
|
||||
|
|
@ -62,7 +63,7 @@ class SystemBasic extends BaseController
|
|||
* @param int $backUrl
|
||||
* @param string $title
|
||||
* @return mixed
|
||||
* @throws \Exception
|
||||
* @throws Exception
|
||||
*/
|
||||
protected function successfulNoticeLast($msg = '操作成功',$backUrl = 0,$info = '')
|
||||
{
|
||||
|
|
@ -73,7 +74,7 @@ class SystemBasic extends BaseController
|
|||
* 错误提醒页面
|
||||
* @param string $msg
|
||||
* @param int $url
|
||||
* @throws \Exception
|
||||
* @throws Exception
|
||||
*/
|
||||
protected function failed($msg = '哎呀…亲…您访问的页面出现错误', $url = 0)
|
||||
{
|
||||
|
|
@ -89,7 +90,7 @@ class SystemBasic extends BaseController
|
|||
* 成功提醒页面
|
||||
* @param string $msg
|
||||
* @param int $url
|
||||
* @throws \Exception
|
||||
* @throws Exception
|
||||
*/
|
||||
protected function successful($msg, $url = 0)
|
||||
{
|
||||
|
|
@ -103,7 +104,7 @@ class SystemBasic extends BaseController
|
|||
|
||||
/**异常抛出
|
||||
* @param $name
|
||||
* @throws \Exception
|
||||
* @throws Exception
|
||||
*/
|
||||
protected function exception($msg = '无法打开页面')
|
||||
{
|
||||
|
|
@ -113,7 +114,7 @@ class SystemBasic extends BaseController
|
|||
|
||||
/**找不到页面
|
||||
* @param $name
|
||||
* @throws \Exception
|
||||
* @throws Exception
|
||||
*/
|
||||
public function _empty($name)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -303,7 +303,7 @@
|
|||
formData.append("cid",id);
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/admin/files/upload",
|
||||
url: "/admin/files/image",
|
||||
enctype: 'multipart/form-data',
|
||||
data: formData,
|
||||
processData: false,
|
||||
|
|
|
|||
Loading…
Reference in New Issue