mirror of
https://gitlab.52pay.top/go/easygoadmin.git
synced 2025-09-27 03:48:27 +08:00
fix: 修复多图控件空值问题
修复多图控件空值问题
This commit is contained in:
@@ -10,7 +10,6 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"gitlab.52pay.top/go/easygoadmin/utils/gconv"
|
"gitlab.52pay.top/go/easygoadmin/utils/gconv"
|
||||||
"html/template"
|
"html/template"
|
||||||
"reflect"
|
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -249,11 +248,13 @@ func Album(param string, data interface{}, exts string, size int) template.HTML
|
|||||||
}
|
}
|
||||||
</style>`
|
</style>`
|
||||||
var list []string
|
var list []string
|
||||||
switch reflect.ValueOf(data).Kind() {
|
switch data.(type) {
|
||||||
case reflect.Slice:
|
case []string:
|
||||||
list = data.([]string)
|
list = data.([]string)
|
||||||
default:
|
case string:
|
||||||
list = strings.Split(data.(string), ",")
|
if data.(string) != "" {
|
||||||
|
list = strings.Split(data.(string), ",")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 上传控件拼接
|
// 上传控件拼接
|
||||||
for _, v := range list {
|
for _, v := range list {
|
||||||
|
Reference in New Issue
Block a user