🧑‍💻 Fix API /api/asset/upload response body succMap field (#12361)

* 🐛 Fix API `/api/asset/upload` response body `succMap` field

* 🐛 Fix #12255
This commit is contained in:
Yingyi / 颖逸 2024-08-30 09:43:16 +08:00 committed by GitHub
parent 6a3095c56c
commit b924452eab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View file

@ -126,7 +126,7 @@ export class Options {
url: Constants.UPLOAD_ADDRESS,
extraData: {},
fieldName: "file[]",
filename: (name: string) => name.replace(/[\\/:*?"'<>|]/g, ""),
filename: (name: string) => name.replace(/[\\/:*?"'<>|\[\]\(\)~!`&{}=#%$]/g, ""),
linkToImgUrl: "",
withCredentials: false,
}

View file

@ -100,7 +100,7 @@ func InsertLocalAssets(id string, assetPaths []string, isUpload bool) (succMap m
return
}
f.Close()
succMap[fName] = "assets/" + fName
succMap[baseName] = "assets/" + fName
}
}
IncSync()
@ -284,7 +284,7 @@ func Upload(c *gin.Context) {
os.RemoveAll(tmpDir2)
}
succMap[fName] = strings.TrimPrefix(path.Join(relAssetsDirPath, fName), "/")
succMap[baseName] = strings.TrimPrefix(path.Join(relAssetsDirPath, fName), "/")
}
}