File tree 1 file changed +2
-3
lines changed 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ func NeedLogin() echo.MiddlewareFunc {
76
76
method := ctx .Request ().Method ()
77
77
if util .IsAjax (ctx ) {
78
78
if ! strings .HasPrefix (ctx .Path (), "/account" ) {
79
- return ctx .JSON (http .StatusForbidden , `{ "ok":0, "error":"403 Forbidden"}` )
79
+ return ctx .JSON (http .StatusForbidden , map [ string ] interface {}{ "ok" : 0 , "error" : "403 Forbidden" })
80
80
}
81
81
} else {
82
82
if method == "POST" {
@@ -137,6 +137,5 @@ func AppNeedLogin() echo.MiddlewareFunc {
137
137
138
138
func outputAppJSON (ctx echo.Context , code int , msg string ) error {
139
139
AccessControl (ctx )
140
- respJSON := `{"code":` + strconv .Itoa (code ) + `,"msg":"` + msg + `}`
141
- return ctx .JSON (http .StatusForbidden , respJSON )
140
+ return ctx .JSON (http .StatusForbidden , map [string ]interface {}{"code" : strconv .Itoa (code ), "msg" : msg })
142
141
}
You can’t perform that action at this time.
0 commit comments