Skip to content

Commit

Permalink
Merge pull request #4 from yangchnet/fix/file-store
Browse files Browse the repository at this point in the history
fix: file type store list
  • Loading branch information
yangchnet authored Jan 3, 2025
2 parents 04f1c01 + 3f03eb4 commit c053d25
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 c053d25

Please sign in to comment.