|
@@ -3,6 +3,7 @@ package manage
|
|
|
import (
|
|
|
"encoding/json"
|
|
|
"fmt"
|
|
|
+ "net/http"
|
|
|
"net/url"
|
|
|
"qfw/coreconfig"
|
|
|
cutil "qfw/coreutil"
|
|
@@ -571,6 +572,14 @@ func (this *CourseManage) CreateOnLineApi() {
|
|
|
if mongodb.Save("jy_course", mData) == "" {
|
|
|
return &FuncResult{false, errors.New("增加课程失败"), nil}
|
|
|
} else {
|
|
|
+ if fileUrl != "" {
|
|
|
+ //生成访问地址
|
|
|
+ http.Get(coreconfig.SysConfig.SpdbGetUrl + "/course/fileInit?fileId="+fileUrl+"&model=file")
|
|
|
+ }
|
|
|
+ if picUrl != "" {
|
|
|
+ //生成访问地址
|
|
|
+ http.Get(coreconfig.SysConfig.SpdbGetUrl + "/course/fileInit?fileId="+picUrl+"&model=img")
|
|
|
+ }
|
|
|
return &FuncResult{true, nil, nil}
|
|
|
}
|
|
|
} else if Dotype == "edit" {
|
|
@@ -596,6 +605,14 @@ func (this *CourseManage) CreateOnLineApi() {
|
|
|
if !updateFlag {
|
|
|
return &FuncResult{false, errors.New("修改课程失败"), nil}
|
|
|
} else {
|
|
|
+ if fileUrl != "" {
|
|
|
+ //生成访问地址
|
|
|
+ http.Get(coreconfig.SysConfig.SpdbGetUrl + "/course/fileInit?fileId="+fileUrl+"&model=file")
|
|
|
+ }
|
|
|
+ if picUrl != "" {
|
|
|
+ //生成访问地址
|
|
|
+ http.Get(coreconfig.SysConfig.SpdbGetUrl + "/course/fileInit?fileId="+picUrl+"&model=img")
|
|
|
+ }
|
|
|
return &FuncResult{true, nil, nil}
|
|
|
}
|
|
|
}
|