优化一些逻辑。

This commit is contained in:
2026-08-06 17:45:06 +08:00
parent ea293f7866
commit ec1a19f469
5 changed files with 13 additions and 26 deletions
+2 -2
View File
@@ -147,7 +147,7 @@ func CreateTheme(c *gin.Context) {
}
// 创建主题目录
if err := os.MkdirAll(themePath, 0755); err != nil {
if err := os.MkdirAll(themePath, 0700); err != nil {
c.JSON(http.StatusInternalServerError, gin.H{
"error": "创建主题目录失败",
})
@@ -411,7 +411,7 @@ func SaveThemeFile(c *gin.Context) {
}
// 保存文件
if err := os.WriteFile(filePath, []byte(req.Content), 0644); err != nil {
if err := os.WriteFile(filePath, []byte(req.Content), 0600); err != nil {
c.JSON(http.StatusInternalServerError, gin.H{
"error": "保存文件失败",
})