修改错误返回
This commit is contained in:
@@ -16,6 +16,16 @@ public class R extends HashMap<String, Object> {
|
||||
put("msg", "success");
|
||||
}
|
||||
|
||||
public static R error() {
|
||||
// return error(HttpStatus.SC_INTERNAL_SERVER_ERROR, "未知异常,请联系管理员");
|
||||
return error(500, "");
|
||||
|
||||
}
|
||||
|
||||
public static R error(String msg) {
|
||||
return error(500, msg);
|
||||
}
|
||||
|
||||
public static R error(int code, String msg) {
|
||||
R r = new R();
|
||||
r.put("code", code);
|
||||
|
||||
Reference in New Issue
Block a user