🚨 fix warnings [no ci]
This commit is contained in:
parent
220e698d3b
commit
cbef1fcf8a
@ -724,7 +724,7 @@ func (ma *memberAPI) updateSetting(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
if yes, err := utils.IsDirEmpty("resource/template/theme-" + sf.Theme); err != nil || yes {
|
||||
if yes, err := utils.IsTemplateDirEmpty("theme-" + sf.Theme); err != nil || yes {
|
||||
c.JSON(http.StatusOK, model.Response{
|
||||
Code: http.StatusBadRequest,
|
||||
Message: fmt.Sprintf("前台主题文件异常:%s", err),
|
||||
@ -732,7 +732,7 @@ func (ma *memberAPI) updateSetting(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
if yes, err := utils.IsDirEmpty("resource/template/dashboard-" + sf.DashboardTheme); err != nil || yes {
|
||||
if yes, err := utils.IsTemplateDirEmpty("dashboard-" + sf.DashboardTheme); err != nil || yes {
|
||||
c.JSON(http.StatusOK, model.Response{
|
||||
Code: http.StatusBadRequest,
|
||||
Message: fmt.Sprintf("后台主题文件异常:%s", err),
|
||||
|
@ -97,8 +97,8 @@ func SplitIPAddr(v4v6Bundle string) (string, string, string) {
|
||||
return ipv4, ipv6, validIP
|
||||
}
|
||||
|
||||
func IsDirEmpty(name string) (bool, error) {
|
||||
f, err := os.Open(filepath.Join("./", filepath.Clean(name)))
|
||||
func IsTemplateDirEmpty(name string) (bool, error) {
|
||||
f, err := os.Open(filepath.Join("resource/template/", filepath.Clean(name)))
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user