|
@@ -1,6 +1,7 @@
|
|
|
package api
|
|
|
|
|
|
import (
|
|
|
+ "cr-svc/conf"
|
|
|
"cr-svc/db/model"
|
|
|
"cr-svc/db/repo"
|
|
|
"fmt"
|
|
@@ -15,8 +16,6 @@ func Upload(r *GinRouter) {
|
|
|
r.POSTJWT("/upload/pkg", UploadPkg)
|
|
|
}
|
|
|
|
|
|
-var LocalHost = "http://192.168.110.238:8085/cr/pkg"
|
|
|
-
|
|
|
func UploadPkg(c *gin.Context, apictx *ApiSession) (interface{}, error) {
|
|
|
|
|
|
version := c.PostForm("version")
|
|
@@ -39,7 +38,7 @@ func UploadPkg(c *gin.Context, apictx *ApiSession) (interface{}, error) {
|
|
|
UserId: userId,
|
|
|
UserName: apictx.User.Name,
|
|
|
Name: name,
|
|
|
- Url: fmt.Sprintf("%s/%s", LocalHost, file.Filename),
|
|
|
+ Url: fmt.Sprintf("%s/%s", conf.AppConfig.UploadPkgUrl, file.Filename),
|
|
|
Size: size,
|
|
|
Version: version,
|
|
|
CreateTime: time.Now(),
|