|
@@ -176,7 +176,9 @@ func (stdDoc *StdDoc) Recommend() {
|
|
|
}
|
|
|
|
|
|
func (stdDoc *StdDoc) GetDoc(sign string) {
|
|
|
- userId := common.ObjToString(stdDoc.GetSession("userId"))
|
|
|
+ //userId := common.ObjToString(stdDoc.GetSession("userId"))
|
|
|
+ userInfo := public.GetUserBaseInfo(stdDoc.Session())
|
|
|
+ userId := userInfo.UserId
|
|
|
rData, errMsg := func() (interface{}, error) {
|
|
|
docId := stdDoc.GetString("docId")
|
|
|
if docId == "" {
|
|
@@ -195,8 +197,19 @@ func (stdDoc *StdDoc) GetDoc(sign string) {
|
|
|
if b, _ := redis.Exists(public.RedisCode, fmt.Sprintf("file_upload_ing_%s", fileId)); b {
|
|
|
return nil, fmt.Errorf("文档正在上传中,请稍后再试")
|
|
|
}
|
|
|
+ if detail.OssDocId == "" {
|
|
|
+ // 下载接口
|
|
|
+ _, err := rpc.PartDocDownload(docId, userInfo.MgoUserId, userInfo.Phone, userInfo.PositionId)
|
|
|
+ if err != nil {
|
|
|
+ log.Println("GetDoc PartDocDownload 获取失败")
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ domain := config.JyDocsAppConfig.OssBucket.Std
|
|
|
+ if detail.Source == public.SourceDd {
|
|
|
+ domain = config.JyDocsAppConfig.OssBucket.Docin
|
|
|
}
|
|
|
- url, err := rpc.GetFileContext(userId, fileId)
|
|
|
+ url, err := rpc.GetFileContext(userId, fileId, domain)
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
}
|