Skip to content
This repository has been archived by the owner on May 27, 2024. It is now read-only.

Commit

Permalink
文件操作
Browse files Browse the repository at this point in the history
  • Loading branch information
CuteReimu committed May 15, 2024
1 parent 8822c1a commit dd13d1b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions request.go
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ type FileInfo struct {
Name string `json:"name"`
Id string `json:"id"`
Path string `json:"path"`
Parent string `json:"parent"`
Parent any `json:"parent"`
Contact Group `json:"contact"`
IsFile bool `json:"isFile"`
IsDictionary bool `json:"isDictionary"`
Expand Down Expand Up @@ -521,7 +521,7 @@ func (b *Bot) GetFileInfo(param FileParam) (*FileInfo, error) {
return nil, errors.New(e)
}
fileList := &FileInfo{}
if err = json.Unmarshal([]byte(result.Raw), fileList); err != nil {
if err = json.Unmarshal([]byte(result.Get("data").Raw), fileList); err != nil {
e := fmt.Sprint("unmarshal json failed: ", err)
slog.Error(e)
return nil, err
Expand All @@ -542,7 +542,7 @@ func (b *Bot) FileMkdir(param FileParam) (*FileInfo, error) {
return nil, errors.New(e)
}
fileList := &FileInfo{}
if err = json.Unmarshal([]byte(result.Raw), fileList); err != nil {
if err = json.Unmarshal([]byte(result.Get("data").Raw), fileList); err != nil {
e := fmt.Sprint("unmarshal json failed: ", err)
slog.Error(e)
return nil, err
Expand Down

0 comments on commit dd13d1b

Please sign in to comment.