感谢两位大佬的指点。问题解决了,之前请求一直报400错误,于是修改了请求的传参,还有optiono.js里的actions感觉写的不对,也给改了下,有不足之处还望指点
option.js修改两处
const keys =
'blog_url,' +
'attachment_upload_image_preview_enable,' +
'attachment_upload_max_parallel_uploads,' +
'attachment_upload_max_files'
actions: {
loadOptions({ commit }) {
return new Promise((resolve, reject) => {
optionApi
.listAll(keys)
.then(response => {
commit('SET_OPTIONS', response.data.data)
resolve(response)
})
.catch(error => {
reject(error)
})
})
}
}
OptionController.java修改为
`@GetMapping("map_view")
@ApiOperation("Lists all options with map view")
public Map<String, Object> listAllWithMapView(@RequestParam(value = "keys", required = false) String keys) {
String[] split = keys.split(",");
List<String> list = Arrays.asList(split);
if (CollectionUtils.isEmpty(list)) {
return optionService.listOptions();
}
return optionService.listOptions(list);
}`