Commit b68392cd authored by ZZH's avatar ZZH

fix revise news 2024-03-11

parent 3e3b3681
...@@ -36,12 +36,16 @@ async def post_publish_news(request, *args, **kwargs) -> SuccessRsp: ...@@ -36,12 +36,16 @@ async def post_publish_news(request, *args, **kwargs) -> SuccessRsp:
@summary("重新编辑文章(标题|内容|封面|文章分类|发布时间|关键词|描述)") @summary("重新编辑文章(标题|内容|封面|文章分类|发布时间|关键词|描述)")
async def post_revise_news(request, body: ReviseNewsReq) -> SuccessRsp: async def post_revise_news(request, *args, **kwargs) -> SuccessRsp:
is_success, url_article, url_cover = await upload_news_qs(request) is_success, url_article, url_cover = await upload_news_qs(request)
if is_success: if is_success:
d_news_info = dict(title=body.title, pub_time=body.pub_time, form = request.form
keywords=body.keywords, contents=body.contents, d_news_info = dict(news_id=form.get("news_id"),
news_type=int(body.news_type)) title=form.get("title"),
pub_time=form.get("pub_time"),
keywords=form.get("keywords"),
contents=form.get("contents"),
news_type=int(form.get("news_type")))
await update_news_info(d_news_info, url_article, url_cover) await update_news_info(d_news_info, url_article, url_cover)
return SuccessRsp(success=1, message="修改文章成功") return SuccessRsp(success=1, message="修改文章成功")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment