mirror of
https://gitlab.52pay.top/go/easygoadmin.git
synced 2025-09-27 06:34:15 +08:00
fix: 多图上传空间兼容字符串
多图上传空间兼容字符串
This commit is contained in:
@@ -248,11 +248,16 @@ func Album(param string, data interface{}, exts string, size int) template.HTML
|
||||
display: inline-block;
|
||||
}
|
||||
</style>`
|
||||
|
||||
var list []string
|
||||
switch reflect.ValueOf(data).Kind() {
|
||||
case reflect.Slice:
|
||||
list = data.([]string)
|
||||
default:
|
||||
list = strings.Split(data.(string), ",")
|
||||
}
|
||||
// 上传控件拼接
|
||||
if reflect.ValueOf(data).Kind() == reflect.Slice {
|
||||
for _, v := range data.([]string) {
|
||||
html += `<div class="layui-upload-drag">
|
||||
for _, v := range list {
|
||||
html += `<div class="layui-upload-drag">
|
||||
<div class="del_img" onclick="remove_image_` + albumName + `(this);">
|
||||
<img src="/resource/assets/images/delete.png">
|
||||
</div>
|
||||
@@ -260,7 +265,6 @@ func Album(param string, data interface{}, exts string, size int) template.HTML
|
||||
<img name="img_src_` + albumName + `" src="` + v + `" alt="` + albumTips + `(点击放大预览)" title="` + albumTips + `(点击放大预览)" width="` + sizeArr[0] + `" height="` + sizeArr[1] + `">
|
||||
</a>
|
||||
</div>`
|
||||
}
|
||||
}
|
||||
html += `<div class="layui-upload-drag img_upload_` + albumName + `">
|
||||
<img id="upload_album_` + albumName + `" src="/resource/assets/images/default_upload.png" alt="上传` + albumTips + `" title="上传` + albumTips + `" width="` + sizeArr[0] + `" height="` + sizeArr[1] + `">
|
||||
|
Reference in New Issue
Block a user