From df7fee966e963f161ff68f570e9c361cf9c39bd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Wed, 21 Jul 2021 11:55:08 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=93=E5=AD=98=E8=B7=AF=E5=BE=84=E4=B8=BA/?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E4=B8=8D=E5=86=8D=E6=8F=90=E7=A4=BA=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/caches/list_file.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/caches/list_file.go b/internal/caches/list_file.go index b42d572..e1db937 100644 --- a/internal/caches/list_file.go +++ b/internal/caches/list_file.go @@ -54,7 +54,12 @@ func (this *FileList) Init() error { this.itemsTableName = "cacheItems_v2" - db, err := sql.Open("sqlite3", "file:"+this.dir+"/index.db?cache=shared&mode=rwc&_journal_mode=WAL") + var dir = this.dir + if dir == "/" { + // 防止sqlite提示authority错误 + dir = "" + } + db, err := sql.Open("sqlite3", "file:"+dir+"/index.db?cache=shared&mode=rwc&_journal_mode=WAL") if err != nil { return err }