fix(upload): Use the correct upload type

This commit is contained in:
LinkinStars 2023-08-02 17:27:42 +08:00
parent fcf29b1a79
commit 3c4c91b2aa
2 changed files with 6 additions and 3 deletions

View File

@ -160,7 +160,7 @@ func (us *uploaderService) AvatarThumbFile(ctx *gin.Context, fileName string, si
func (us *uploaderService) UploadPostFile(ctx *gin.Context) ( func (us *uploaderService) UploadPostFile(ctx *gin.Context) (
url string, err error) { url string, err error) {
url, err = us.tryToUploadByPlugin(ctx, plugin.UserAvatar) url, err = us.tryToUploadByPlugin(ctx, plugin.UserPost)
if err != nil { if err != nil {
return "", err return "", err
} }
@ -186,7 +186,7 @@ func (us *uploaderService) UploadPostFile(ctx *gin.Context) (
func (us *uploaderService) UploadBrandingFile(ctx *gin.Context) ( func (us *uploaderService) UploadBrandingFile(ctx *gin.Context) (
url string, err error) { url string, err error) {
url, err = us.tryToUploadByPlugin(ctx, plugin.UserAvatar) url, err = us.tryToUploadByPlugin(ctx, plugin.AdminBranding)
if err != nil { if err != nil {
return "", err return "", err
} }

View File

@ -21,7 +21,10 @@ var (
".png": true, ".png": true,
}, },
AdminBranding: { AdminBranding: {
".ico": true, ".jpg": true,
".jpeg": true,
".png": true,
".ico": true,
}, },
} }
) )