Skip to content

Commit

Permalink
Merge pull request #127 from Baihhh/mergeDev
Browse files Browse the repository at this point in the history
fix: Remove currentHref.
  • Loading branch information
IRONICBo committed Feb 8, 2024
2 parents 1fe2f12 + a1b7c98 commit cf1fbcd
Show file tree
Hide file tree
Showing 10 changed files with 6,268 additions and 6,304 deletions.
17 changes: 9 additions & 8 deletions cmd/gopcomm/community_yap.gox
Original file line number Diff line number Diff line change
Expand Up @@ -331,40 +331,41 @@ get "/getTrans", ctx => {
// click "submit" button
post "/commit", ctx => {
// Whether article has been translated or not
trans := ctx.param("trans") // if trans != "", add article
// trans := ctx.param("trans") // if trans != "", add article
id := ctx.param("id")
mdData := ctx.param("content")
htmlData := ctx.param("html")
// htmlData := ctx.param("html")
// get user id
token, err := core.GetToken(ctx)
if err != nil {
xLog.Info("token",err)
ctx.json {
"code": 500,
"code": 0,
"err": "no token",
}
}
uid, err := community.ParseJwtToken(token.Value)
if err != nil {
xLog.Info("uid",err)
ctx.json {
"code": 500,
"code": 0,
"err": err.Error(),
}
}
// uid := "70f6a615-c0d5-4315-a5ac-34ca845450ed"
// add article
article := &core.Article{
ArticleEntry: core.ArticleEntry{
ID: id,
Title: ctx.param("title"),
UId: uid,
Cover: ctx.param("cover"),
// TODO /upload Cover: ctx.param("cover"),
Tags: ctx.param("tags"),
Abstract: ctx.param("abstract"),
},
Content: mdData,
HtmlData: htmlData,
// HtmlData: htmlData,
}
id, _ = community.PutArticle(todo, uid, trans, article)
id, _ = community.PutArticle(todo, uid, "", article)
ctx.json {
"code": 200,
"data": id,
Expand Down
Loading

0 comments on commit cf1fbcd

Please sign in to comment.