diff --git a/app/admin/controller/Tag.php b/app/admin/controller/Tag.php index f5d942f..96f6f94 100644 --- a/app/admin/controller/Tag.php +++ b/app/admin/controller/Tag.php @@ -10,118 +10,118 @@ use think\Request; class Tag extends Common { - /** - * 显示资源列表 - * - * @return \think\Response - */ - public function index() - { - // + /** + * 显示资源列表 + * + * @return \think\Response + */ + public function index() + { + // - $list_tag = ModelTag::order('id desc') - ->where('type',$this->request->param('type',1)) - ->paginate(); + $list_tag = ModelTag::order('id desc') + ->where('type', $this->request->param('type', 1)) + ->paginate(); - if($this->request->isAjax()){ - return json_message($list_tag); + if ($this->request->isAjax()) { + return json_message($list_tag); + } + + View::assign('list', $list_tag); + + return View::fetch(); } - View::assign('list',$list_tag); - - return View::fetch(); - } - - /** - * 显示创建资源表单页. - * - * @return \think\Response - */ - public function create() - { - // - } - - /** - * 保存新建的资源 - * - * @param \think\Request $request - * @return \think\Response - */ - public function save(Request $request) - { - // - - $post_data = $request->post(); - - $arr = explode(' ',$post_data['tags']); - - $arr = array_unique(array_filter($arr)); - - foreach ($arr as $tag) { - $model_tag = ModelTag::where('title',$tag)->find(); - - if(empty($model_tag)){ - ModelTag::create(['title'=>$tag]); - } + /** + * 显示创建资源表单页. + * + * @return \think\Response + */ + public function create() + { + // } - return json_message(); - } + /** + * 保存新建的资源 + * + * @param \think\Request $request + * @return \think\Response + */ + public function save(Request $request) + { + // - /** - * 显示指定的资源 - * - * @param int $id - * @return \think\Response - */ - public function read($id) - { - // - } + $post_data = $request->post(); - /** - * 显示编辑资源表单页. - * - * @param int $id - * @return \think\Response - */ - public function edit($id) - { - // + $arr = explode(' ', $post_data['tags']); - } + $arr = array_unique(array_filter($arr)); - /** - * 保存更新的资源 - * - * @param \think\Request $request - * @param int $id - * @return \think\Response - */ - public function update(Request $request, $id) - { - // + foreach ($arr as $tag) { + $model_tag = ModelTag::where('title', $tag)->find(); - $post_data = $request->post(); + if (empty($model_tag)) { + ModelTag::create(['title' => $tag, 'type' => $request->param('type',1)]); + } + } - $post_data['title'] = str_replace(' ','',$post_data['title']); - - $model_tag = ModelTag::find($id); + return json_message(); + } - $model_tag->save($post_data); + /** + * 显示指定的资源 + * + * @param int $id + * @return \think\Response + */ + public function read($id) + { + // + } - return json_message(); - } + /** + * 显示编辑资源表单页. + * + * @param int $id + * @return \think\Response + */ + public function edit($id) + { + // - /** - * 删除指定资源 - * - * @param int $id - * @return \think\Response - */ - public function delete($id) - { - // - } + } + + /** + * 保存更新的资源 + * + * @param \think\Request $request + * @param int $id + * @return \think\Response + */ + public function update(Request $request, $id) + { + // + + $post_data = $request->post(); + + $post_data['title'] = str_replace(' ', '', $post_data['title']); + + $model_tag = ModelTag::find($id); + + $model_tag->save($post_data); + + return json_message(); + } + + /** + * 删除指定资源 + * + * @param int $id + * @return \think\Response + */ + public function delete($id) + { + // + } } diff --git a/app/model/Post.php b/app/model/Post.php index ab9a2d2..1f0b8cd 100644 --- a/app/model/Post.php +++ b/app/model/Post.php @@ -157,7 +157,7 @@ class Post extends Model { $url_info = parse_url((string)url('index/Index/index')->domain('www')); - return $url_info['scheme'] . '://' . $url_info['host'] . '/a' . $this->getData('uid') . '.html'; + return $url_info['scheme'] . '://' . $url_info['host'] . '/index/a' . $this->getData('uid') . '.html'; } public function getShareTextAttr() diff --git a/view/admin/post/create.html b/view/admin/post/create.html index 996490a..fe3ad34 100644 --- a/view/admin/post/create.html +++ b/view/admin/post/create.html @@ -2,477 +2,478 @@ - - - - 内容管理 - {include file="common/_require"} - - - + + + + 内容管理 + {include file="common/_require"} + + + - + -
- {include file="common/_header"} +
+ {include file="common/_header"} - {include file="common/left_post"} + {include file="common/left_post"} -
+
-
-
- - 首页 - 内容管理 - +
+
+ + 首页 + 内容管理 + +
+
+
+
+ +
+
+ 添加 +
+ + +
+
标题
+
+ +
+
+ +
+
封面
+
+ +
+
上传
+
+
+ +
+
+
+
+
描述
+
+ +
+
+ +
+
内容
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+ +
+ +
+
+
+
+
+ 信息 +
+
+
状态
+
+ + +
+
+
+
发表时间
+
+ +
+
+
+
分类
+
+
+ + +
+
+ +
+
+ + +
新增
+
+
+ +
+
+
+
标签
+
+
+ +
+
+
+ +
新增
+
+
+ +
+
+
+
是否置顶
+
+ + +
+
+
+
跳转链接
+
+ +
+
+
+
跳转按钮名称
+
+ +
+
+
+
跳转链接状态
+
+ + + +
+
+
+
+ 作者名称 +

不填使用系统设置的名称

+
+
+ +
+
+
+
排序
+
+ +
越大越靠前
+
+
+
+
模板
+
+ +
+
+
+
+
+
+
+
+
-
-
-
- -
-
- 添加 -
-
-
标题
-
- -
-
+ {include file="common/_footer"} -
-
封面
-
- -
-
上传
-
-
- -
-
-
-
-
描述
-
- -
-
- -
-
内容
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - + -
- -
-
-
- -
- -
- -
-
-
-
-
- 信息 -
-
-
状态
-
- - -
-
-
-
发表时间
-
- -
-
-
-
分类
-
-
- - -
-
- -
-
- - -
新增
-
-
- -
-
-
-
标签
-
-
- -
-
-
- -
新增
-
-
- -
-
-
-
是否置顶
-
- - -
-
-
-
跳转链接
-
- -
-
-
-
跳转按钮名称
-
- -
-
-
-
跳转链接状态
-
- - - -
-
-
-
- 作者名称 -

不填使用系统设置的名称

-
-
- -
-
-
-
排序
-
- -
越大越靠前
-
-
-
-
模板
-
- -
-
-
-
-
-
-
-
+ + \ No newline at end of file diff --git a/view/admin/post/edit.html b/view/admin/post/edit.html index c9da2fa..f9967ae 100644 --- a/view/admin/post/edit.html +++ b/view/admin/post/edit.html @@ -2,527 +2,523 @@ - - - - 内容管理 - {include file="common/_require"} - - + + + + 内容管理 + {include file="common/_require"} + + - + - + -
- {include file="common/_header"} +
+ {include file="common/_header"} - {include file="common/left_post"} + {include file="common/left_post"} -
+
-
-
- - 首页 - 内容管理 - +
+
+ + 首页 + 内容管理 + +
+
+
+
+ +
+
+ 编辑 +
+ + +
+
标题
+
+ +
+
+ +
+
封面
+
+ +
+
上传
+
+
+ +
+
+
+
+
描述
+
+ +
+
+ +
+
内容
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ +
+
+ +
+ +
+ +
+
+
+
+
+ 信息 +
+
+
状态
+
+ + +
+
+
+
发表时间
+
+ +
+
+
+
分类
+
+
+ +
+
+ +
+
+ + +
新增
+
+
+ +
+
+
+
标签
+
+
+ +
+
+
+ +
新增
+
+
+ +
+
+
+
是否置顶
+
+ + +
+
+
+
跳转链接
+
+ +
+
+
+
跳转按钮名称
+
+ +
+
+ +
+
跳转链接状态
+
+ + + +
+
+
+
+ 作者名称 +

不填使用系统设置的名称

+
+
+ +
+
+
+
排序
+
+ +
越大越靠前
+
+
+
+
模板
+
+ +
+
+
+
+
+
+
+
+
-
-
-
- -
-
- 编辑 -
-
-
标题
-
- -
-
+ {include file="common/_footer"} -
-
封面
-
- -
-
上传
-
-
- -
-
-
-
-
描述
-
- -
-
+ -
-
-
-
- 信息 -
-
-
状态
-
- - -
-
-
-
发表时间
-
- -
-
-
-
分类
-
-
- -
-
- -
-
- - -
新增
-
-
- -
-
-
-
标签
-
-
- -
-
-
- -
新增
-
-
- -
-
-
-
是否置顶
-
- - -
-
-
-
跳转链接
-
- -
-
-
-
跳转按钮名称
-
- -
-
- -
-
跳转链接状态
-
- - - -
-
-
-
- 作者名称 -

不填使用系统设置的名称

-
-
- -
-
-
-
排序
-
- -
越大越靠前
-
-
-
-
模板
-
- -
-
-
-
-
-
-
-
+ + \ No newline at end of file