mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 07:00:12 +01:00
🎨 改进导入 data.zip 和 .sy.zip 校验失败时的提示 Fix https://github.com/siyuan-note/siyuan/issues/7738
This commit is contained in:
parent
37e88627c0
commit
3130eaa033
6 changed files with 18 additions and 8 deletions
|
|
@ -112,7 +112,7 @@ func ImportSY(zipPath, boxID, toPath string) (err error) {
|
|||
}
|
||||
if 1 != len(unzipRootPaths) {
|
||||
logging.LogErrorf("invalid .sy.zip")
|
||||
return errors.New("invalid .sy.zip")
|
||||
return errors.New(Conf.Language(199))
|
||||
}
|
||||
unzipRootPath := unzipRootPaths[0]
|
||||
luteEngine := util.NewLute()
|
||||
|
|
@ -422,7 +422,7 @@ func ImportData(zipPath string) (err error) {
|
|||
return errors.New("check data.zip failed")
|
||||
}
|
||||
if 0 < len(files) {
|
||||
return errors.New("invalid data.zip")
|
||||
return errors.New(Conf.Language(198))
|
||||
}
|
||||
dirs, err := os.ReadDir(unzipPath)
|
||||
if nil != err {
|
||||
|
|
@ -430,7 +430,7 @@ func ImportData(zipPath string) (err error) {
|
|||
return errors.New("check data.zip failed")
|
||||
}
|
||||
if 1 != len(dirs) {
|
||||
return errors.New("invalid data.zip")
|
||||
return errors.New(Conf.Language(198))
|
||||
}
|
||||
|
||||
tmpDataPath := filepath.Join(unzipPath, dirs[0].Name())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue