🧑💻 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:
parent
6a3095c56c
commit
b924452eab
2 changed files with 3 additions and 3 deletions
|
@ -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,
|
||||
}
|
||||
|
|
|
@ -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), "/")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue