From b970185536bc58742fc29946b50c487a2de52bac Mon Sep 17 00:00:00 2001 From: kknd97 <liujingwei@ln.chinamobile.com> Date: 星期四, 20 十月 2022 14:27:02 +0800 Subject: [PATCH] update ruoyi-ui/src/views/system/user/index.vue. handleUpdate(row)方法中:this.form = response.data;语句 会导致【this.form.postIds = response.postIds;】和【this.form.roleIds = response.roleIds;】失效。 导致用户编辑对话框中,角色和部门多选框无法正常修改。 建议使用以下语句修改: this.$set(this.form, "postIds", response.postIds); this.$set(this.form, "roleIds", response.roleIds); --- ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java | 39 ++++++++++++++++++++++++++++++++++++++- 1 files changed, 38 insertions(+), 1 deletions(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java index 04ae9b1..f8a39d3 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java @@ -17,6 +17,7 @@ import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.uuid.IdUtils; +import org.apache.commons.io.FilenameUtils; /** * 鏂囦欢澶勭悊宸ュ叿绫� @@ -196,7 +197,6 @@ * * @param response 鍝嶅簲瀵硅薄 * @param realFileName 鐪熷疄鏂囦欢鍚� - * @return */ public static void setAttachmentResponseHeader(HttpServletResponse response, String realFileName) throws UnsupportedEncodingException { @@ -210,7 +210,9 @@ .append("utf-8''") .append(percentEncodedFileName); + response.addHeader("Access-Control-Expose-Headers", "Content-Disposition,download-filename"); response.setHeader("Content-disposition", contentDispositionValue.toString()); + response.setHeader("download-filename", percentEncodedFileName); } /** @@ -253,4 +255,39 @@ } return strFileExtendName; } + + /** + * 鑾峰彇鏂囦欢鍚嶇О /profile/upload/2022/04/16/ruoyi.png -- ruoyi.png + * + * @param fileName 璺緞鍚嶇О + * @return 娌℃湁鏂囦欢璺緞鐨勫悕绉� + */ + public static String getName(String fileName) + { + if (fileName == null) + { + return null; + } + int lastUnixPos = fileName.lastIndexOf('/'); + int lastWindowsPos = fileName.lastIndexOf('\\'); + int index = Math.max(lastUnixPos, lastWindowsPos); + return fileName.substring(index + 1); + } + + /** + * 鑾峰彇涓嶅甫鍚庣紑鏂囦欢鍚嶇О /profile/upload/2022/04/16/ruoyi.png -- ruoyi + * + * @param fileName 璺緞鍚嶇О + * @return 娌℃湁鏂囦欢璺緞鍜屽悗缂�鐨勫悕绉� + */ + public static String getNameNotSuffix(String fileName) + { + if (fileName == null) + { + return null; + } + String baseName = FilenameUtils.getBaseName(fileName); + return baseName; + } + } -- Gitblit v1.9.3