/**
* 前后台通信测试,后台通信post请求测试
*/
@PreAuthorize("@ss.hasPermi('rule:entryrule:list')")
@PostMapping(value = "/tongxin")
public AjaxResult tongxintest(@RequestBody JSONObject total)
{
//在json中查找phonenumber值,将他转为字符串类型,然后使用length函数返回位数
String aa=String.valueOf(total.getInteger("phonenumber"));
return success(aa.length());
}
/**
* 前后台通信测试,后台通信get请求测试,成功。
*/
//如果要使用get请求时加参数,那么需要加入PathVariable("total")
@PreAuthorize("@ss.hasPermi('rule:entryrule:query')")
@GetMapping(value = "/tongxin/{total}")
public String tongxintest(@PathVariable("total") String total)
{
return total;
}
springboot+vue前后台通信测试,get或post请求测试
最新推荐文章于 2024-07-23 11:07:53 发布