|
@@ -71,7 +71,7 @@ func (stdDoc *StdDoc) Detail() {
|
|
|
if from != "" { //分享赚积分
|
|
|
go public.OpenShareJydoc(encrypt.SE.DecodeString(from), userId, docId)
|
|
|
}
|
|
|
- detail, isBuy, err := rpc.GetDocDetail(userId, docId)
|
|
|
+ detail, isBuy, IsCollect, err := rpc.GetDocDetail(userId, docId)
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
@@ -80,8 +80,9 @@ func (stdDoc *StdDoc) Detail() {
|
|
|
detail.OssDocId = ""
|
|
|
detail.PreviewImgId = fmt.Sprintf("https://%s.%s/%s", config.JyDocsAppConfig.OssBucket.Priv, config.JyDocsAppConfig.OssAdmin, detail.PreviewImgId)
|
|
|
return map[string]interface{}{
|
|
|
- "status": common.If(isBuy, 1, 0),
|
|
|
- "detail": detail,
|
|
|
+ "status": common.If(isBuy, 1, 0),
|
|
|
+ "collect": common.If(IsCollect, 1, 0),
|
|
|
+ "detail": detail,
|
|
|
}, nil
|
|
|
}()
|
|
|
if errMsg != nil {
|
|
@@ -97,7 +98,7 @@ func (stdDoc *StdDoc) GetDoc(sign string) {
|
|
|
if docId == "" {
|
|
|
return nil, fmt.Errorf("参数异常")
|
|
|
}
|
|
|
- detail, isBuy, err := rpc.GetDocDetail(userId, docId)
|
|
|
+ detail, isBuy, _, err := rpc.GetDocDetail(userId, docId)
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
@@ -112,6 +113,9 @@ func (stdDoc *StdDoc) GetDoc(sign string) {
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
|
+ if strings.HasPrefix(url, "http://") {
|
|
|
+ url = strings.Replace(url, "http://", "https://", 1)
|
|
|
+ }
|
|
|
return url, nil
|
|
|
}()
|
|
|
if errMsg != nil {
|