blade调用接口时出错

Blade 未结 1 812
goti
goti 剑童 2020-06-18 17:00

What steps will reproduce the problem? 

该问题的重现步骤是什么?

用postman请求接口的时候,返回了一个奇怪信息,很奇怪,不应该会出现这个问题的

java.lang.String cannot be cast to org.springblade.core.tool.api.R

 

What is the expected output? What do you see instead? 

你期待的结果是什么?实际看到的又是什么?

 我期待接口返回成功,

实际看到了 

java.lang.String cannot be cast to org.springblade.core.tool.api.R

 

What version of the product are you using? On what operating system? 

你正在使用产品的哪个版本?在什么操作系统上?

 

2.7.1 windows10

 

Please provide any additional information below.

如果有的话,请在下面提供更多信息。


接口代码

namename

请求

image.png

结果

image.png

1条回答
  • 2020-06-18 17:01
    @GetMapping("info")
    @PreAuth("permitAll()")
    @Cacheable(cacheNames = "learn-info", key = "#name")
    public R<String> info(String name){
      return  R.data("this info is "+name);
    }

    接口代码

    回答: 2020-06-18 17:08

    image.png

    已解决,请求格式有问题

    0 讨论(0)
提交回复