【修改】去除error500方法,全都替换为error
【修改】修改token过期,但是接口访问依然不返回登录页的bug
This commit is contained in:
+1
-1
@@ -144,7 +144,7 @@ public class MockController {
|
||||
res.setResult(list);
|
||||
res.setMessage("查询成功");
|
||||
} catch (Exception e) {
|
||||
res.error500("查询失败"+e.getMessage());
|
||||
return Result.error("查询失败"+e.getMessage());
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
+5
-5
@@ -88,7 +88,7 @@ public class JoaDemoController {
|
||||
return Result.OK("添加成功!");
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(),e);
|
||||
return Result.error500("操作失败");
|
||||
return Result.error("操作失败");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ public class JoaDemoController {
|
||||
public Result<Object> edit(@RequestBody JoaDemo joaDemo) {
|
||||
JoaDemo joaDemoEntity = joaDemoService.getById(joaDemo.getId());
|
||||
if(joaDemoEntity==null) {
|
||||
return Result.error500("未找到对应实体");
|
||||
return Result.error("未找到对应实体");
|
||||
}else {
|
||||
boolean ok = joaDemoService.updateById(joaDemo);
|
||||
if(ok) {
|
||||
@@ -121,7 +121,7 @@ public class JoaDemoController {
|
||||
public Result<Object> delete(@RequestParam(name="id",required=true) String id) {
|
||||
JoaDemo joaDemo = joaDemoService.getById(id);
|
||||
if(joaDemo==null) {
|
||||
return Result.error500("未找到对应实体");
|
||||
return Result.error("未找到对应实体");
|
||||
}else {
|
||||
boolean ok = joaDemoService.removeById(id);
|
||||
if(ok) {
|
||||
@@ -139,7 +139,7 @@ public class JoaDemoController {
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<Object> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
if(ids==null || "".equals(ids.trim())) {
|
||||
return Result.error500("参数不识别!");
|
||||
return Result.error("参数不识别!");
|
||||
}else {
|
||||
this.joaDemoService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("删除成功!");
|
||||
@@ -155,7 +155,7 @@ public class JoaDemoController {
|
||||
public Result<JoaDemo> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
JoaDemo joaDemo = joaDemoService.getById(id);
|
||||
if(joaDemo==null) {
|
||||
return Result.error500("未找到对应实体");
|
||||
return Result.error("未找到对应实体");
|
||||
}else {
|
||||
return Result.OK(joaDemo);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user