|
@@ -6,7 +6,9 @@ import (
|
|
|
tables "hongze/hongze_open_api/models/tables/report"
|
|
|
"hongze/hongze_open_api/models/tables/wx_user"
|
|
|
"hongze/hongze_open_api/utils"
|
|
|
+ "net/url"
|
|
|
"strconv"
|
|
|
+ "strings"
|
|
|
"time"
|
|
|
)
|
|
|
|
|
@@ -34,7 +36,7 @@ func (c *ReportController) ListReport() {
|
|
|
currentIndex, _ := c.GetInt("_page")
|
|
|
keyWord := c.GetString("keyword")
|
|
|
reportType := c.GetString("report_type")
|
|
|
- mobile := c.GetString("mobile")
|
|
|
+ //mobile := c.GetString("mobile")
|
|
|
var startSize int
|
|
|
if pageSize <= 0 {
|
|
|
pageSize = utils.PageSize20
|
|
@@ -43,6 +45,23 @@ func (c *ReportController) ListReport() {
|
|
|
currentIndex = 1
|
|
|
}
|
|
|
startSize = utils.StartIndex(currentIndex, pageSize)
|
|
|
+ //通过url获取mobile中的参数
|
|
|
+ var mobile string
|
|
|
+ URL, err := url.Parse(c.Ctx.Input.URI())
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println(err)
|
|
|
+ c.FailWithMessage("获取报告失败")
|
|
|
+ return
|
|
|
+ }
|
|
|
+ urlParameter := URL.RawQuery
|
|
|
+ sliceUrl := strings.Split(urlParameter, "&")
|
|
|
+ if len(sliceUrl) > 0 {
|
|
|
+ for _, v := range sliceUrl {
|
|
|
+ if strings.Contains(v, "mobile=") {
|
|
|
+ mobile = strings.Replace(v, "mobile=", "", -1)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
if mobile == "" {
|
|
|
c.FailWithMessage("mobile 必传")
|
|
|
return
|
|
@@ -120,16 +139,31 @@ func (c *ReportController) ListReport() {
|
|
|
// @router /getReportInfo [get]
|
|
|
func (c *ReportControllerCommon) GetReportInfo() {
|
|
|
researchReportId, _ := c.GetInt("research_report_id")
|
|
|
- mobile := c.GetString("mobile")
|
|
|
+ //mobile := c.GetString("mobile")
|
|
|
if researchReportId < 1 {
|
|
|
c.FailWithMessage("请传入报告id")
|
|
|
return
|
|
|
}
|
|
|
+ var mobile string
|
|
|
+ URL, err := url.Parse(c.Ctx.Input.URI())
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println(err)
|
|
|
+ c.FailWithMessage("获取报告失败")
|
|
|
+ return
|
|
|
+ }
|
|
|
+ urlParameter := URL.RawQuery
|
|
|
+ sliceUrl := strings.Split(urlParameter, "&")
|
|
|
+ if len(sliceUrl) > 0 {
|
|
|
+ for _, v := range sliceUrl {
|
|
|
+ if strings.Contains(v, "mobile=") {
|
|
|
+ mobile = strings.Replace(v, "mobile=", "", -1)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
if mobile == "" {
|
|
|
c.FailWithMessage("mobile 必传")
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
var dateTxt = []byte(mobile)
|
|
|
resultDe := utils.DesBase64Decrypt(dateTxt)
|
|
|
deMobile := string(resultDe)
|
|
@@ -188,11 +222,28 @@ func (c *ReportControllerCommon) GetReportInfo() {
|
|
|
// @router /getReportChapterInfo [get]
|
|
|
func (c *ReportControllerCommon) GetResearchReportChapter() {
|
|
|
researchReportTypeId, _ := c.GetInt("ResearchReportTypeId")
|
|
|
- mobile := c.GetString("mobile")
|
|
|
+ //mobile := c.GetString("mobile")
|
|
|
if researchReportTypeId < 1 {
|
|
|
c.FailWithMessage("请传入章节id")
|
|
|
return
|
|
|
}
|
|
|
+ //通过url获取mobile中的参数
|
|
|
+ var mobile string
|
|
|
+ URL, err := url.Parse(c.Ctx.Input.URI())
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println(err)
|
|
|
+ c.FailWithMessage("获取报告失败")
|
|
|
+ return
|
|
|
+ }
|
|
|
+ urlParameter := URL.RawQuery
|
|
|
+ sliceUrl := strings.Split(urlParameter, "&")
|
|
|
+ if len(sliceUrl) > 0 {
|
|
|
+ for _, v := range sliceUrl {
|
|
|
+ if strings.Contains(v, "mobile=") {
|
|
|
+ mobile = strings.Replace(v, "mobile=", "", -1)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
if mobile == "" {
|
|
|
c.FailWithMessage("mobile 必传")
|
|
|
return
|