check resource exists when bind classpath
This commit is contained in:
parent
12e3b3a490
commit
f21909adb8
|
@ -59,6 +59,7 @@ var (
|
|||
"Regexp %s matched, but cannot get substring()": "主正则 %s 匹配成功,但无法匹配到子串",
|
||||
"TagKey or TagValue contains illegal characters[:,/=\r\n\t]": "标签KEY或者标签值包含非法字符串[:,/=\r\n\t]",
|
||||
"Resource cannot delete in preset classpath": "预置分组不能删除资源",
|
||||
"No such resource %s": "不存在该资源(%s)",
|
||||
}
|
||||
langDict = map[string]map[string]string{
|
||||
"zh": dict,
|
||||
|
|
|
@ -56,6 +56,15 @@ func ClasspathResourceAdd(classpathId int64, resIdent string) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
res, err := ResourceGet("ident=?", resIdent)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if res == nil {
|
||||
return _e("No such resource %s", resIdent)
|
||||
}
|
||||
|
||||
obj := ClasspathResource{
|
||||
ClasspathId: classpathId,
|
||||
ResIdent: resIdent,
|
||||
|
|
Loading…
Reference in New Issue