设备列表-上传设备图像
This commit is contained in:
@ -102,7 +102,7 @@ public class EmsSiteConfigController extends BaseController{
|
|||||||
public AjaxResult uploadDeviceImg(@RequestParam("avatarfile") MultipartFile file) throws Exception
|
public AjaxResult uploadDeviceImg(@RequestParam("avatarfile") MultipartFile file) throws Exception
|
||||||
{
|
{
|
||||||
if (!file.isEmpty()) {
|
if (!file.isEmpty()) {
|
||||||
String avatar = FileUploadUtils.upload(RuoYiConfig.getAvatarPath(), file, MimeTypeUtils.IMAGE_EXTENSION);
|
String avatar = FileUploadUtils.upload(RuoYiConfig.getDevicePath(), file, MimeTypeUtils.IMAGE_EXTENSION);
|
||||||
|
|
||||||
AjaxResult ajax = AjaxResult.success();
|
AjaxResult ajax = AjaxResult.success();
|
||||||
ajax.put("imgUrl", avatar);
|
ajax.put("imgUrl", avatar);
|
||||||
|
|||||||
@ -119,4 +119,12 @@ public class RuoYiConfig
|
|||||||
{
|
{
|
||||||
return getProfile() + "/upload";
|
return getProfile() + "/upload";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取头像上传路径
|
||||||
|
*/
|
||||||
|
public static String getDevicePath()
|
||||||
|
{
|
||||||
|
return getProfile() + "/device";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user