feat:完善项目
This commit is contained in:
@ -45,7 +45,7 @@ type ImageForm struct {
|
||||
}
|
||||
|
||||
func (this *ImageForm) FilterImageURL() string {
|
||||
return strings.Replace(this.Image, config.SettingInfo.Domain, "", -1)
|
||||
return strings.Replace(this.Image, config.SystemConfig[config.SysImageDomain], "", -1)
|
||||
}
|
||||
|
||||
type ImagesForm struct {
|
||||
@ -56,7 +56,7 @@ func (this *ImagesForm) FilterImageURL() string {
|
||||
out := make([]string, 0)
|
||||
|
||||
for _, v := range strings.Split(this.Images, ",") {
|
||||
out = append(out, strings.Replace(v, config.SettingInfo.Domain, "", -1))
|
||||
out = append(out, strings.Replace(v, config.SystemConfig[config.SysImageDomain], "", -1))
|
||||
}
|
||||
return strings.Join(out, ",")
|
||||
}
|
||||
@ -66,7 +66,7 @@ type FileForm struct {
|
||||
}
|
||||
|
||||
func (this *FileForm) FilterURL() string {
|
||||
return strings.Replace(this.File, config.SettingInfo.Domain, "", -1)
|
||||
return strings.Replace(this.File, config.SystemConfig[config.SysImageDomain], "", -1)
|
||||
}
|
||||
|
||||
type PositionForm struct {
|
||||
|
@ -53,10 +53,8 @@ func (a *Upload) Upload(c *gin.Context) {
|
||||
}
|
||||
resp := new(lib.UploadHandle)
|
||||
|
||||
if resp, err = lib.Upload(config.SystemConfig[config.UploadPath].(string),
|
||||
strings.Split(config.SystemConfig[config.UploadExt].(string), ","),
|
||||
utils.StringToInt64(config.SystemConfig[config.UploadSize].(string)),
|
||||
true).Handle()(file, config.SettingInfo.Domain); err != nil {
|
||||
if resp, err = lib.Upload(config.SystemConfig[config.UploadPath], strings.Split(config.SystemConfig[config.UploadExt], ","),
|
||||
utils.StringToInt64(config.SystemConfig[config.UploadSize]), true).Handle()(file, config.SystemConfig[config.SysImageDomain]); err != nil {
|
||||
APIFailure(err)(c)
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user