mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-02 19:40:19 +08:00
feat: expose email and sms APIs as services to SDK (#202)
Signed-off-by: Kininaru <shiftregister233@outlook.com> invalid receivers
This commit is contained in:
@ -49,8 +49,16 @@ func InitHttpClient() {
|
||||
//println("Response status: %s", resp.Status)
|
||||
}
|
||||
|
||||
func (c *ApiController) ResponseError(error string) {
|
||||
c.Data["json"] = Response{Status: "error", Msg: error}
|
||||
func (c *ApiController) ResponseError(error string, data ...interface{}) {
|
||||
resp := Response{Status: "error", Msg: error}
|
||||
switch len(data) {
|
||||
case 2:
|
||||
resp.Data2 = data[1]
|
||||
fallthrough
|
||||
case 1:
|
||||
resp.Data = data[0]
|
||||
}
|
||||
c.Data["json"] = resp
|
||||
c.ServeJSON()
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user