diff --git a/casdoorsdk/email.go b/casdoorsdk/email.go index 895c855..ea4c539 100644 --- a/casdoorsdk/email.go +++ b/casdoorsdk/email.go @@ -14,10 +14,7 @@ package casdoorsdk -import ( - "encoding/json" - "fmt" -) +import "encoding/json" type emailForm struct { Title string `json:"title"` @@ -38,14 +35,9 @@ func (c *Client) SendEmail(title string, content string, sender string, receiver return err } - resp, err := c.DoPost("send-email", nil, postBytes, false, false) + _, err = c.DoPost("send-email", nil, postBytes, false, false) if err != nil { return err } - - if resp.Status != "ok" { - return fmt.Errorf(resp.Msg) - } - return nil } diff --git a/casdoorsdk/resource.go b/casdoorsdk/resource.go index 5ba8c6a..b6ff362 100644 --- a/casdoorsdk/resource.go +++ b/casdoorsdk/resource.go @@ -132,10 +132,6 @@ func (c *Client) UploadResource(user string, tag string, parent string, fullFile return "", "", err } - if resp.Status != "ok" { - return "", "", fmt.Errorf(resp.Msg) - } - fileUrl := resp.Data.(string) name := resp.Data2.(string) return fileUrl, name, nil @@ -158,10 +154,6 @@ func (c *Client) UploadResourceEx(user string, tag string, parent string, fullFi return "", "", err } - if resp.Status != "ok" { - return "", "", fmt.Errorf(resp.Msg) - } - fileUrl := resp.Data.(string) name := resp.Data2.(string) return fileUrl, name, nil