增加品牌管理,品牌动态选择

This commit is contained in:
19173159168
2025-08-12 21:53:13 +08:00
parent 6fadd0aed9
commit 91aa3aaa79
5 changed files with 30 additions and 37 deletions

View File

@ -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();