We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在文件上传那里,点击文件上传,报错 云存储配置 使用了 七牛,但是点击上传时 saveUploadResult(url){ this.$http({ url: this.$http.adornUrl('/sys/oss/upload'), method: 'post', data:{ url:url } }).then(({data})=>{ this.$emit('uploaded', url) }) 使用了腾讯的,方法执行到这里了, 而后台的这个接口是接收 @RequestParam("file") MultipartFile file 导致报错 /** * 上传文件 */ @PostMapping("/upload") @RequiresPermissions("sys:oss:all") @operation(summary = "上传文件到OSS") public R upload(@RequestParam("file") MultipartFile file) throws Exception { if (file.isEmpty()) { throw new RRException("上传文件不能为空"); }
//上传文件 String suffix = Objects.requireNonNull(file.getOriginalFilename()).substring(file.getOriginalFilename().lastIndexOf(".")); String url = Objects.requireNonNull(OSSFactory.build()).uploadSuffix(file.getBytes(), suffix); //保存文件信息 SysOssEntity ossEntity = new SysOssEntity(); ossEntity.setUrl(url); ossEntity.setCreateDate(new Date()); sysOssService.save(ossEntity); return R.ok().put("url", url); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
在文件上传那里,点击文件上传,报错
云存储配置 使用了 七牛,但是点击上传时
saveUploadResult(url){
this.$http({
url: this.$http.adornUrl('/sys/oss/upload'),
method: 'post',
data:{
url:url
}
}).then(({data})=>{
this.$emit('uploaded', url)
})
使用了腾讯的,方法执行到这里了,
而后台的这个接口是接收 @RequestParam("file") MultipartFile file 导致报错
/**
* 上传文件
*/
@PostMapping("/upload")
@RequiresPermissions("sys:oss:all")
@operation(summary = "上传文件到OSS")
public R upload(@RequestParam("file") MultipartFile file) throws Exception {
if (file.isEmpty()) {
throw new RRException("上传文件不能为空");
}
The text was updated successfully, but these errors were encountered: