diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..9c7e6e5 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 blue + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 6abc829..dd44e48 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ #### 介绍 本项目为盒子IM后台管理,主要为盒子IM提供用户管理、群组管理、消息管理、敏感词管理等后台功能。 -建议先把业务服务跑起来,再回来搭建后台服务: +建议先把业务服务跑起来,再回来搭建后台服务: 盒子IM业务仓库地址:https://gitee.com/bluexsx/box-im 详细文档: https://www.yuque.com/u1475064/mufu2a diff --git a/im-admin-ui/src/components/ImageUpload/index.vue b/im-admin-ui/src/components/ImageUpload/index.vue index 637d42a..1b62739 100644 --- a/im-admin-ui/src/components/ImageUpload/index.vue +++ b/im-admin-ui/src/components/ImageUpload/index.vue @@ -59,7 +59,7 @@ const props = defineProps({ }); const { proxy } = getCurrentInstance() as ComponentInternalInstance; -const emit = defineEmits(['update:modelValue']); +const emit = defineEmits(['update:modelValue', 'on-success']); const dialogImageUrl = ref(''); const dialogVisible = ref(false); @@ -99,6 +99,7 @@ const handleBeforeUpload = (file: any) => { // 上传成功回调 const handleUploadSuccess = (res: any) => { if (res.code === 200) { + emit('on-success', res.data); emit('update:modelValue', res.data.originUrl); } else { emit('update:modelValue', ''); diff --git a/im-admin/ruoyi-common/ruoyi-common-web/src/main/java/org/dromara/common/web/core/I18nLocaleResolver.java b/im-admin/ruoyi-common/ruoyi-common-web/src/main/java/org/dromara/common/web/core/I18nLocaleResolver.java index 98ddd06..c877cd3 100644 --- a/im-admin/ruoyi-common/ruoyi-common-web/src/main/java/org/dromara/common/web/core/I18nLocaleResolver.java +++ b/im-admin/ruoyi-common/ruoyi-common-web/src/main/java/org/dromara/common/web/core/I18nLocaleResolver.java @@ -15,12 +15,35 @@ public class I18nLocaleResolver implements LocaleResolver { @Override public Locale resolveLocale(HttpServletRequest httpServletRequest) { - String language = httpServletRequest.getHeader("content-language"); - Locale locale = Locale.getDefault(); - if (language != null && language.length() > 0) { - String[] split = language.split("_"); - locale = new Locale(split[0], split[1]); + String languageHeader = httpServletRequest.getHeader("content-language"); + Locale locale; + + if (languageHeader != null && !languageHeader.isEmpty()) { + // 处理可能的逗号分隔的语言列表 + String[] languages = languageHeader.split(","); + String preferredLanguage = languages[0]; // 取第一个语言标签作为首选 + + // 处理语言标签的格式(可能包含语言、国家、区域) + String[] parts = preferredLanguage.split("-"); + switch (parts.length) { + case 1: // 只有语言代码 + locale = new Locale(parts[0]); + break; + case 2: // 语言代码和国家代码 + locale = new Locale(parts[0], parts[1]); + break; + case 3: // 语言代码、国家代码和区域代码 + locale = new Locale(parts[0], parts[1], parts[2]); + break; + default: // 默认回退到默认语言环境 + locale = Locale.getDefault(); + break; + } + } else { + // 如果没有 content-language 头部,使用默认语言环境 + locale = Locale.getDefault(); } + return locale; } @@ -28,4 +51,4 @@ public class I18nLocaleResolver implements LocaleResolver { public void setLocale(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Locale locale) { } -} +} \ No newline at end of file