增加品牌管理,品牌动态选择
This commit is contained in:
@ -284,30 +284,30 @@ public class CommonController
|
||||
try
|
||||
{
|
||||
/** oss --------------- */
|
||||
// // 检查文件是否为空
|
||||
// if (file.isEmpty()) {
|
||||
// return AjaxResult.error("上传文件不能为空");
|
||||
// }
|
||||
//
|
||||
// // 检查文件类型(可选)
|
||||
// String contentType = file.getContentType();
|
||||
// if (contentType == null || !contentType.startsWith("image/")) {
|
||||
// return AjaxResult.error("只允许上传图片文件");
|
||||
// }
|
||||
//
|
||||
// // 上传到 OSS
|
||||
// String url = ossService.uploadImage(file);
|
||||
// // 返回文件访问 URL
|
||||
// String[] str = url.split("/");
|
||||
// String fileName = str[str.length - 1];
|
||||
// 检查文件是否为空
|
||||
if (file.isEmpty()) {
|
||||
return AjaxResult.error("上传文件不能为空");
|
||||
}
|
||||
|
||||
// 检查文件类型(可选)
|
||||
String contentType = file.getContentType();
|
||||
if (contentType == null || !contentType.startsWith("image/")) {
|
||||
return AjaxResult.error("只允许上传图片文件");
|
||||
}
|
||||
|
||||
// 上传到 OSS
|
||||
String url = ossService.uploadImage(file);
|
||||
// 返回文件访问 URL
|
||||
String[] str = url.split("/");
|
||||
String fileName = str[str.length - 1];
|
||||
|
||||
/** 原文件上传 --------------- */
|
||||
// 上传文件路径
|
||||
String filePath = RuoYiConfig.getUploadPath();
|
||||
// 上传并返回新文件名称
|
||||
String fileName = FileUploadUtils.upload(filePath, fileType, file);
|
||||
|
||||
String url = serverConfig.getUrl() + fileName;
|
||||
// // 上传文件路径
|
||||
// String filePath = RuoYiConfig.getUploadPath();
|
||||
// // 上传并返回新文件名称
|
||||
// String fileName = FileUploadUtils.upload(filePath, fileType, file);
|
||||
//
|
||||
// String url = serverConfig.getUrl() + fileName;
|
||||
/** -------------------------- */
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
CommonAttachment insert = new CommonAttachment();
|
||||
|
||||
Reference in New Issue
Block a user