This commit is contained in:
2025-07-07 19:47:48 +08:00
parent 879db8e2b4
commit fe15c444f7
5 changed files with 133 additions and 40 deletions
+4
View File
@@ -52,6 +52,10 @@ func All_config_init() {
if err != nil {
panic(err)
}
//fmt.Println(Configs_file)
//fmt.Println(Allowed_avatar_mime)
//创建file的关键文件夹
for _, value := range Configs_file.Pahts {
err := os.MkdirAll(value, 0755)
+6 -6
View File
@@ -17,10 +17,10 @@ type Configs_user_t struct {
}
type Configs_file_t struct {
Max_size_mb uint `mapstructure:"max_size_mb"`
Pahts []string `mapstructure:"pahts"`
Allow_image_mime []map[string]bool `mapstructure:"allow_image_mime"`
Allow_video_mime []map[string]bool `mapstructure:"allow_video_mime"`
Allow_music_mime []map[string]bool `mapstructure:"allow_music_mime"`
Allow_pdf_mime []map[string]bool `mapstructure:"allow_pdf_mime"`
Max_size uint64 `mapstructure:"max_size"`
Pahts []string `mapstructure:"pahts"`
Allow_image_mime map[string]bool `mapstructure:"allow_image_mime"`
Allow_video_mime map[string]bool `mapstructure:"allow_video_mime"`
Allow_music_mime map[string]bool `mapstructure:"allow_music_mime"`
Allow_pdf_mime map[string]bool `mapstructure:"allow_pdf_mime"`
}