mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-31 22:08:48 +01:00
🎨 If a file with the same name exists during export PDF/Docx, it will be automatically renamed https://github.com/siyuan-note/siyuan/issues/11357
This commit is contained in:
parent
abf92b602c
commit
749ed8a4ac
4 changed files with 36 additions and 19 deletions
|
|
@ -36,6 +36,21 @@ import (
|
|||
"github.com/siyuan-note/siyuan/kernel/util"
|
||||
)
|
||||
|
||||
func getUniqueFilename(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
arg, ok := util.JsonArg(c, ret)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
|
||||
filePath := arg["path"].(string)
|
||||
ret.Data = map[string]interface{}{
|
||||
"path": util.GetUniqueFilename(filePath),
|
||||
}
|
||||
}
|
||||
|
||||
func globalCopyFiles(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue