Skip to content

Commit

Permalink
解决README获取下载地址异常
Browse files Browse the repository at this point in the history
  • Loading branch information
libsgh committed Jul 7, 2021
1 parent 501dfc0 commit fa35680
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (
)

var UrlCache = gcache.New(100).LRU().Build()
var dl = DownLock{}

func GetFilesByPath(account entity.Account, path, pwd string) map[string]interface{} {
if path == "" {
Expand Down Expand Up @@ -148,6 +147,9 @@ func GetFilesByPath(account entity.Account, path, pwd string) map[string]interfa
model.SqliteDb.Raw("select * from file_node where parent_path=? and file_name=? and `delete`=0 and account_id=?", path, "README.md", account.Id).Find(&readmeFile)
if !readmeFile.IsFolder && readmeFile.FileName == "README.md" {
result["HasReadme"] = true
dl := DownLock{}
dl.FileId = readmeFile.FileId
dl.L = new(sync.Mutex)
result["ReadmeContent"] = Util.ReadStringByUrl(dl.GetDownlaodUrl(account, readmeFile), readmeFile.FileId)
}
}
Expand Down

0 comments on commit fa35680

Please sign in to comment.