1.后台引入
/**
* 通过id查询.
*/
@ResponseBody
@GetMapping("/queryById")
//@ResponseBody
//@DeleteMapping("/delete")
public Result<OSSfile> queryById(@RequestParam(name = "id") String id) {
Result<OSSFile> result = new Result<>();
OSSFile file = ossFileService.getById(id);
System.out.println(file.toString());
System.out.println(file.getFileName());
//file.setUrl(url)
if (file == null) {
result.error500("未找到对应实体");
}
else {
String sts_url= "" sts_url(file.getFileName());
file.setUrl(sts_url);
result.setResult(file);
result.setSuccess(true);
}
return result;
}
2.前端引入:
3.页面访问:
4,日志:Security Token: CAIS4AJ1q6Ft5B2yfSjIr5fUMtHCoKkVjrvTREHaoGEGfs5bvpSTizz2IHlIfnNrCOgZtPs2mmxQ7v8YloFJQppiXlf4YNBs
Copyright © 2024 妖气游戏网 www.17u1u.com All Rights Reserved