function(res) {
that.results.push({ title: “字符串”, result: res.data });
},
function(err) {
console.log(err);
}
);
},
- BackEnd
@ResponseBody
@RequestMapping(value = “hex2decimal”, method = RequestMethod.POST)
public String hex2Decimal(String hex) {
return ConverterUtil.hex2Decimal(hex);
}
后台Spring端使用@requestBody接收
- FrontEnd
hex2str1(hex) {
let that = this;
// method2: send parameter as usual, but use @RequestBody Map<String, String> to receive in Spring
let data = { hex: hex };
this.$http.post(“/test/tool/hex2string1”, data).then(
function(res) {
that.results.push({ title: “字符串”, result: res.data });
},
function(err) {