Selaa lähdekoodia

接收策略平台报告,APPID获取方式修改

xingzai 2 vuotta sitten
vanhempi
commit
09479611df
2 muutettua tiedostoa jossa 8 lisäystä ja 7 poistoa
  1. 7 7
      controllers/report.go
  2. 1 0
      models/request/article/article.go

+ 7 - 7
controllers/report.go

@@ -267,19 +267,19 @@ func (c *ReportControllerCommon) GetResearchReportChapter() {
 // @Success 200 创建成功
 // @router /article/change [post]
 func (c *ReportController) ArticleChange() {
-	//appid权限校验
-	appid := c.GetString("appid", "")
-	if utils.RunMode == "release" && appid != "XVuGlcyEEVNYVWx5" {
-		c.FailWithMessage("无权限")
-		return
-	}
+
 	var req article.CreatArticleCeluePushReq
 	err := json.Unmarshal(c.Ctx.Input.RequestBody, &req)
 	if err != nil {
 		c.FailWithMessage("参数解析异常")
 		return
 	}
-
+	//appid权限校验
+	appid := req.Appid
+	if utils.RunMode == "release" && appid != "XVuGlcyEEVNYVWx5" {
+		c.FailWithMessage("无权限")
+		return
+	}
 	articleId := req.ArticleId
 	action := req.Action
 	if articleId < 0 {

+ 1 - 0
models/request/article/article.go

@@ -3,5 +3,6 @@ package article
 // CreateUserReq 新增用户的结构体
 type CreatArticleCeluePushReq struct {
 	ArticleId int    `description:"文章ID" json:"article_id"`
+	Appid     string `description:"文章ID" json:"appid"`
 	Action    string `description:"操作方式 add:新增、edit:修改、move:删除" json:"action"`
 }