修复file上传未设置到用户

This commit is contained in:
junleea 2025-03-28 19:58:46 +08:00
parent 05e40343b5
commit 4b61e7102e
2 changed files with 7 additions and 1 deletions

6
.idea/vcs.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

View File

@ -259,7 +259,7 @@ func UploadFileV2(c *gin.Context) {
}
//添加用户文件
fileAuth := service.CreateUserFile(id1, file_record.FileName, int(file_record.ID), uploadType)
if fileAuth.ID != 0 {
if fileAuth.ID == 0 {
c.JSON(http.StatusOK, gin.H{"error": "save user file info failed", "code": proto.SaveFileInfoFailed, "message": "failed"})
return
}