File tree Expand file tree Collapse file tree 1 file changed +21
-9
lines changed
Expand file tree Collapse file tree 1 file changed +21
-9
lines changed Original file line number Diff line number Diff line change 11package alist_v3
22
33import (
4+ "encoding/json"
45 "time"
56
67 "github.com/OpenListTeam/OpenList/v4/internal/model"
@@ -72,15 +73,26 @@ type LoginResp struct {
7273}
7374
7475type MeResp struct {
75- Id int `json:"id"`
76- Username string `json:"username"`
77- Password string `json:"password"`
78- BasePath string `json:"base_path"`
79- Role []int `json:"role"`
80- Disabled bool `json:"disabled"`
81- Permission int `json:"permission"`
82- SsoId string `json:"sso_id"`
83- Otp bool `json:"otp"`
76+ Id int `json:"id"`
77+ Username string `json:"username"`
78+ Password string `json:"password"`
79+ BasePath string `json:"base_path"`
80+ Role IntSlice `json:"role"`
81+ Disabled bool `json:"disabled"`
82+ Permission int `json:"permission"`
83+ SsoId string `json:"sso_id"`
84+ Otp bool `json:"otp"`
85+ }
86+
87+ type IntSlice []int
88+
89+ func (s * IntSlice ) UnmarshalJSON (b []byte ) error {
90+ var i int
91+ if json .Unmarshal (b , & i ) == nil {
92+ * s = []int {i }
93+ return nil
94+ }
95+ return json .Unmarshal (b , (* []int )(s ))
8496}
8597
8698type ArchiveMetaReq struct {
You can’t perform that action at this time.
0 commit comments