Browse Source

fix:修复研报详情查看

zqbao 9 months ago
parent
commit
226ddf5f00
1 changed files with 16 additions and 2 deletions
  1. 16 2
      controllers/report.go

+ 16 - 2
controllers/report.go

@@ -29,8 +29,22 @@ func (this *ReportController) Detail() {
 	}
 	user := this.User
 	if user == nil {
-		br.Ret = 408
-		br.Msg = "用户未登录"
+		// 如果没有用户没有绑定信息,单独处理
+		resp, er := services.GetReportDetailNoUser(reportId)
+		if er != nil {
+			br.Msg = "查询报告详情失败"
+			br.ErrMsg = "查询报告失败,系统异常,Err:" + er.Error()
+			return
+		}
+		if resp.Ret != 200 {
+			br.Msg = resp.Msg
+			br.ErrMsg = resp.ErrMsg
+			return
+		}
+		br.Msg = "查询成功"
+		br.Data = resp.Data
+		br.Success = true
+		br.Ret = 200
 		return
 	}
 	result, err := services.GetReportDetail(reportId, user.UserId)