Skip to content

Commit

Permalink
fix: file type store list
Browse files Browse the repository at this point in the history
  • Loading branch information
李昌 committed Jan 3, 2025
1 parent 8263478 commit 3f03eb4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion store/file-store/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,17 @@ func (s *FileStore) SearchName(ctx context.Context, name string) ([]*store.Passw
var passwd store.Passwd
content, err := os.ReadFile(path)
if err != nil {
fmt.Println(err)
return nil, err
}

if err := json.Unmarshal(content, &passwd); err != nil {
decodedBytes, err := base64.StdEncoding.DecodeString(string(content))
if err != nil {
fmt.Println("解码失败:", err)
os.Exit(1)
}

if err := json.Unmarshal(decodedBytes, &passwd); err != nil {
return nil, err
}

Expand Down

0 comments on commit 3f03eb4

Please sign in to comment.