From e2602ccde4fe60b6cf14d277f08255599d69bd45 Mon Sep 17 00:00:00 2001 From: wangshaoping Date: Mon, 15 Jan 2024 17:30:35 +0800 Subject: [PATCH] add theme update --- io.sc.platform.core.frontend/package.json | 2 +- .../src/platform/i18n/messages.json | 1 + .../src/platform/i18n/messages_tw_CN.json | 1 + .../src/platform/i18n/messages_zh_CN.json | 1 + .../sub-layout/ChangePasswordDialog.vue | 85 ++++++++++ .../src/platform/layout/sub-layout/Topper.vue | 14 +- .../src/platform/plugin/axios.ts | 10 +- .../src/platform/utils/Tools.ts | 17 ++ .../template-project/package.json | 4 +- .../webpack.env.serve.cjs | 3 + .../sc/platform/core/ApplicationLauncher.java | 3 +- .../PlatformSpringBootServletInitializer.java | 3 +- .../core/bean/GlobalExceptionHandler.java | 4 + .../core/compiler/JavaMemeryFileManager.java | 2 +- .../core/compiler/JavaMemoryCompiler.java | 4 +- .../exception/PlatformRuntimeException.java | 22 +++ .../core/i18n/MessageSourceBaseName.java | 13 +- .../PlatformResourceBundleMessageSource.java | 2 +- .../platform/core/plugins/PluginParser.java | 5 +- .../core/response/ResponseWrapperBuilder.java | 19 ++- .../io/sc/platform/core/util/BeanUtil.java | 2 +- .../sc/platform/core/util/CollectionUtil.java | 33 +--- .../core/util/HttpServletRequestUtil.java | 2 + .../java/io/sc/platform/core/util/IpUtil.java | 26 +-- .../io/sc/platform/core/i18n/words.properties | 1 + .../platform/core/i18n/words_tw_CN.properties | 3 +- .../platform/core/i18n/words_zh_CN.properties | 3 +- .../asciidoc/9999-appendix/java/java.adoc | 20 +++ .../WebSecurityAutoConfiguration.java | 2 +- ...2AuthorizationServerAutoConfiguration.java | 4 +- .../support/PlatformSecurityProperties.java | 154 ------------------ ...Oauth2ResourceServerAutoConfiguration.java | 2 +- .../PlatformJwtAuthenticationConverter.java | 2 +- .../{support => }/SecurityClaimNames.java | 2 +- .../{support => }/SecurityProperties.java | 2 +- .../PlatformWebSecurityAutoConfiguration.java | 1 + .../platform/security/util/SecurityUtil.java | 2 +- io.sc.platform.system.frontend/package.json | 2 +- .../src/i18n/messages.json | 9 +- .../src/i18n/messages_tw_CN.json | 9 +- .../src/i18n/messages_zh_CN.json | 10 +- .../src/views/user/ChangePasswordDialog.vue | 86 ---------- .../src/views/user/SetPasswordDialog.vue | 59 +++++++ .../src/views/user/User.vue | 104 ++++++------ .../user/controller/UserWebController.java | 6 +- .../user/service/impl/UserServiceImpl.java | 18 +- 46 files changed, 391 insertions(+), 388 deletions(-) create mode 100644 io.sc.platform.core.frontend/src/platform/layout/sub-layout/ChangePasswordDialog.vue create mode 100644 io.sc.platform.core/src/main/java/io/sc/platform/core/exception/PlatformRuntimeException.java delete mode 100644 io.sc.platform.security.oauth2.server.authorization/src/main/java/io/sc/platform/security/oauth2/server/authorization/configure/support/PlatformSecurityProperties.java rename io.sc.platform.security/src/main/java/io/sc/platform/security/{support => }/SecurityClaimNames.java (98%) rename io.sc.platform.security/src/main/java/io/sc/platform/security/{support => }/SecurityProperties.java (98%) delete mode 100644 io.sc.platform.system.frontend/src/views/user/ChangePasswordDialog.vue create mode 100644 io.sc.platform.system.frontend/src/views/user/SetPasswordDialog.vue diff --git a/io.sc.platform.core.frontend/package.json b/io.sc.platform.core.frontend/package.json index 10115101..55030f26 100644 --- a/io.sc.platform.core.frontend/package.json +++ b/io.sc.platform.core.frontend/package.json @@ -1,6 +1,6 @@ { "name": "platform-core", - "version": "8.1.60", + "version": "8.1.61", "description": "前端核心包,用于快速构建前端的脚手架", "//main": "库的主文件", "main": "dist/platform-core.js", diff --git a/io.sc.platform.core.frontend/src/platform/i18n/messages.json b/io.sc.platform.core.frontend/src/platform/i18n/messages.json index dbbb0746..13551653 100644 --- a/io.sc.platform.core.frontend/src/platform/i18n/messages.json +++ b/io.sc.platform.core.frontend/src/platform/i18n/messages.json @@ -46,4 +46,5 @@ "tabs.close.all":"Close All Tab", "theme": "Theme", "upToTop": "Up to Top", + "passwordAndConfirmPasswordMustEqual": "Confrim Password and Password must equals" } diff --git a/io.sc.platform.core.frontend/src/platform/i18n/messages_tw_CN.json b/io.sc.platform.core.frontend/src/platform/i18n/messages_tw_CN.json index c407e418..be0b7077 100644 --- a/io.sc.platform.core.frontend/src/platform/i18n/messages_tw_CN.json +++ b/io.sc.platform.core.frontend/src/platform/i18n/messages_tw_CN.json @@ -46,4 +46,5 @@ "tabs.close.all":"關閉所有標籤", "theme": "主題", "upToTop": "回到頂部", + "passwordAndConfirmPasswordMustEqual": "確認密碼和密碼必須一致" } diff --git a/io.sc.platform.core.frontend/src/platform/i18n/messages_zh_CN.json b/io.sc.platform.core.frontend/src/platform/i18n/messages_zh_CN.json index 3b1d410d..19a51866 100644 --- a/io.sc.platform.core.frontend/src/platform/i18n/messages_zh_CN.json +++ b/io.sc.platform.core.frontend/src/platform/i18n/messages_zh_CN.json @@ -46,4 +46,5 @@ "tabs.close.all":"关闭所有标签", "theme": "主题", "upToTop": "回到顶部", + "passwordAndConfirmPasswordMustEqual": "确认密码和密码必须一致" } diff --git a/io.sc.platform.core.frontend/src/platform/layout/sub-layout/ChangePasswordDialog.vue b/io.sc.platform.core.frontend/src/platform/layout/sub-layout/ChangePasswordDialog.vue new file mode 100644 index 00000000..66ac0d63 --- /dev/null +++ b/io.sc.platform.core.frontend/src/platform/layout/sub-layout/ChangePasswordDialog.vue @@ -0,0 +1,85 @@ + + diff --git a/io.sc.platform.core.frontend/src/platform/layout/sub-layout/Topper.vue b/io.sc.platform.core.frontend/src/platform/layout/sub-layout/Topper.vue index aa0fb897..9bc00909 100644 --- a/io.sc.platform.core.frontend/src/platform/layout/sub-layout/Topper.vue +++ b/io.sc.platform.core.frontend/src/platform/layout/sub-layout/Topper.vue @@ -128,11 +128,12 @@ - + - {{ t('changePassword') }} + {{ t('changePassword') }} + {{ t('changeRole') }} @@ -153,6 +154,8 @@ + + @@ -165,12 +168,14 @@ import { useI18n } from 'vue-i18n'; import { Environment, SessionManager, I18nMessageManager } from '@/platform'; import About from './About.vue'; +import ChangePasswordDialog from './ChangePasswordDialog.vue'; const gc = Environment.getConfigure(); const quasar = useQuasar(); const router = useRouter(); const searchContent = ref(''); const showAboutDialog = ref(false); +const changePasswordDialog = ref(); const { t } = useI18n(); const session: UserSessionType = SessionManager.getSession() as UserSessionType; const logoutForm = ref(); @@ -224,6 +229,11 @@ const about = () => { showAboutDialog.value = true; }; +const changePassword = () => { + changePasswordDialog.value.show(); +}; + Environment.registAction('about', about); +Environment.registAction('changePassword', changePassword); Environment.registAction('logout', logout); diff --git a/io.sc.platform.core.frontend/src/platform/plugin/axios.ts b/io.sc.platform.core.frontend/src/platform/plugin/axios.ts index 6fe9a812..1e0f4509 100644 --- a/io.sc.platform.core.frontend/src/platform/plugin/axios.ts +++ b/io.sc.platform.core.frontend/src/platform/plugin/axios.ts @@ -47,6 +47,7 @@ axios.interceptors.response.use( } else { // 业务错误 NotifyManager.error(i18n.global.t(data.errorMessageI18nKey)); + return Promise.reject(data); } }, (error: any) => { @@ -55,16 +56,19 @@ axios.interceptors.response.use( // 发生网络错误 const $t = i18n.global.t; NotifyManager.error($t('NetworkError')); + return Promise.reject(error); } else { - const status = error?.response?.status; - let messageKey = error?.response?.data?.errorMessageI18nKey; + const response = error?.response; + const data = response?.data; + let messageKey = data?.errorMessageI18nKey; if (Tools.isUndefinedOrNull(messageKey)) { - messageKey = error?.response?.status; + messageKey = response?.status; } if (Tools.isUndefinedOrNull(messageKey)) { messageKey = 'error'; } NotifyManager.error(i18n.global.t(messageKey)); + return Promise.reject(data); } }, ); diff --git a/io.sc.platform.core.frontend/src/platform/utils/Tools.ts b/io.sc.platform.core.frontend/src/platform/utils/Tools.ts index f09cd1a8..2e419ef3 100644 --- a/io.sc.platform.core.frontend/src/platform/utils/Tools.ts +++ b/io.sc.platform.core.frontend/src/platform/utils/Tools.ts @@ -750,6 +750,23 @@ class Tools { } return object; } + + /** + * 抽取对象的属性 + * @param objects 对象数组 + * @param propertyName 属性名 + * @returns 属性值数组 + */ + public static extractProperties(objects: object[], propertyName: string): object[] { + if (objects && objects.length > 0 && propertyName) { + const result = []; + for (const object of objects) { + result.push(object[propertyName]); + } + return result; + } + return []; + } } export { Tools }; diff --git a/io.sc.platform.core.frontend/template-project/package.json b/io.sc.platform.core.frontend/template-project/package.json index 4cc91b3d..7f3201d5 100644 --- a/io.sc.platform.core.frontend/template-project/package.json +++ b/io.sc.platform.core.frontend/template-project/package.json @@ -1,6 +1,6 @@ { "name": "platform-core", - "version": "8.1.60", + "version": "8.1.61", "description": "前端核心包,用于快速构建前端的脚手架", "private": false, "keywords": [], @@ -92,7 +92,7 @@ "luckyexcel": "1.0.1", "mockjs": "1.1.0", "pinia": "2.1.7", - "platform-core": "8.1.60", + "platform-core": "8.1.61", "quasar": "2.14.2", "tailwindcss": "3.4.0", "vue": "3.4.3", diff --git a/io.sc.platform.core.frontend/webpack.env.serve.cjs b/io.sc.platform.core.frontend/webpack.env.serve.cjs index 8f21ccb0..e3f793b4 100644 --- a/io.sc.platform.core.frontend/webpack.env.serve.cjs +++ b/io.sc.platform.core.frontend/webpack.env.serve.cjs @@ -12,6 +12,9 @@ module.exports = (env)=> merge(common, mf,{ devtool: 'eval', devServer: { + client: { + overlay: false, + }, static: { directory: path.join(__dirname, 'public'), }, diff --git a/io.sc.platform.core/src/main/java/io/sc/platform/core/ApplicationLauncher.java b/io.sc.platform.core/src/main/java/io/sc/platform/core/ApplicationLauncher.java index 3b2b23ff..33cc720f 100644 --- a/io.sc.platform.core/src/main/java/io/sc/platform/core/ApplicationLauncher.java +++ b/io.sc.platform.core/src/main/java/io/sc/platform/core/ApplicationLauncher.java @@ -1,6 +1,7 @@ package io.sc.platform.core; import com.beust.jcommander.JCommander; +import io.sc.platform.core.exception.PlatformRuntimeException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.boot.SpringApplication; @@ -89,7 +90,7 @@ public class ApplicationLauncher { try { start(); } catch (IOException e) { - throw new RuntimeException(e); + throw new PlatformRuntimeException(e); } }); thread.start(); diff --git a/io.sc.platform.core/src/main/java/io/sc/platform/core/PlatformSpringBootServletInitializer.java b/io.sc.platform.core/src/main/java/io/sc/platform/core/PlatformSpringBootServletInitializer.java index 3993d4c4..521c1b5f 100644 --- a/io.sc.platform.core/src/main/java/io/sc/platform/core/PlatformSpringBootServletInitializer.java +++ b/io.sc.platform.core/src/main/java/io/sc/platform/core/PlatformSpringBootServletInitializer.java @@ -1,5 +1,6 @@ package io.sc.platform.core; +import io.sc.platform.core.exception.PlatformRuntimeException; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; @@ -18,7 +19,7 @@ public abstract class PlatformSpringBootServletInitializer extends SpringBootSer Environment.getInstance().init(this.getClass(),true); return builder.sources(this.getClass()); } catch (IOException e) { - throw new RuntimeException(e); + throw new PlatformRuntimeException(e); } } } diff --git a/io.sc.platform.core/src/main/java/io/sc/platform/core/bean/GlobalExceptionHandler.java b/io.sc.platform.core/src/main/java/io/sc/platform/core/bean/GlobalExceptionHandler.java index e26ecc49..bbc3915e 100644 --- a/io.sc.platform.core/src/main/java/io/sc/platform/core/bean/GlobalExceptionHandler.java +++ b/io.sc.platform.core/src/main/java/io/sc/platform/core/bean/GlobalExceptionHandler.java @@ -4,12 +4,15 @@ import io.sc.platform.core.response.ResponseWrapper; import io.sc.platform.core.response.ResponseWrapperBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.ResponseStatus; import javax.servlet.http.HttpServletRequest; + /** * 全局违例处理 * 仅处理进入 Controller 后发生的违例, 不处理进入 Controller 前发生的违例(例如:认证违例) @@ -19,6 +22,7 @@ public class GlobalExceptionHandler { private static final Logger log = LoggerFactory.getLogger(GlobalExceptionHandler.class); @ExceptionHandler(value =Exception.class) + @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) @ResponseBody public ResponseWrapper exceptionHandler(HttpServletRequest request, Exception e){ log.error("",e); diff --git a/io.sc.platform.core/src/main/java/io/sc/platform/core/compiler/JavaMemeryFileManager.java b/io.sc.platform.core/src/main/java/io/sc/platform/core/compiler/JavaMemeryFileManager.java index 8c4796bf..4f7a6c86 100644 --- a/io.sc.platform.core/src/main/java/io/sc/platform/core/compiler/JavaMemeryFileManager.java +++ b/io.sc.platform.core/src/main/java/io/sc/platform/core/compiler/JavaMemeryFileManager.java @@ -10,7 +10,7 @@ import java.util.ArrayList; import java.util.List; public class JavaMemeryFileManager extends ForwardingJavaFileManager { - private List javaMemeryClassObjects = new ArrayList(); + private List javaMemeryClassObjects = new ArrayList<>(); private JavaMemeryClassLoader classLoader; protected JavaMemeryFileManager(JavaFileManager fileManager, JavaMemeryClassLoader classLoader) { diff --git a/io.sc.platform.core/src/main/java/io/sc/platform/core/compiler/JavaMemoryCompiler.java b/io.sc.platform.core/src/main/java/io/sc/platform/core/compiler/JavaMemoryCompiler.java index 8ecfb976..f0147924 100644 --- a/io.sc.platform.core/src/main/java/io/sc/platform/core/compiler/JavaMemoryCompiler.java +++ b/io.sc.platform.core/src/main/java/io/sc/platform/core/compiler/JavaMemoryCompiler.java @@ -11,7 +11,7 @@ public class JavaMemoryCompiler { private Iterable options; boolean ignoreWarnings = false; - private Map sourceCodeMap = new HashMap(); + private Map sourceCodeMap = new HashMap<>(); public JavaMemoryCompiler() { this.compiler = ToolProvider.getSystemJavaCompiler(); @@ -97,7 +97,7 @@ public class JavaMemoryCompiler { } } - Map> classes = new HashMap>(); + Map> classes = new HashMap<>(); for (String className : sourceCodeMap.keySet()) { classes.put(className, classLoader.loadClass(className)); } diff --git a/io.sc.platform.core/src/main/java/io/sc/platform/core/exception/PlatformRuntimeException.java b/io.sc.platform.core/src/main/java/io/sc/platform/core/exception/PlatformRuntimeException.java new file mode 100644 index 00000000..135d92e8 --- /dev/null +++ b/io.sc.platform.core/src/main/java/io/sc/platform/core/exception/PlatformRuntimeException.java @@ -0,0 +1,22 @@ +package io.sc.platform.core.exception; + +public class PlatformRuntimeException extends RuntimeException{ + public PlatformRuntimeException() { + } + + public PlatformRuntimeException(String message) { + super(message); + } + + public PlatformRuntimeException(String message, Throwable cause) { + super(message, cause); + } + + public PlatformRuntimeException(Throwable cause) { + super(cause); + } + + public PlatformRuntimeException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { + super(message, cause, enableSuppression, writableStackTrace); + } +} diff --git a/io.sc.platform.core/src/main/java/io/sc/platform/core/i18n/MessageSourceBaseName.java b/io.sc.platform.core/src/main/java/io/sc/platform/core/i18n/MessageSourceBaseName.java index 4c3dc046..7c37bd9f 100644 --- a/io.sc.platform.core/src/main/java/io/sc/platform/core/i18n/MessageSourceBaseName.java +++ b/io.sc.platform.core/src/main/java/io/sc/platform/core/i18n/MessageSourceBaseName.java @@ -1,20 +1,19 @@ package io.sc.platform.core.i18n; import io.sc.platform.core.plugins.PluginManager; -import org.springframework.util.StringUtils; import java.util.ArrayList; import java.util.List; -import static org.springframework.util.StringUtils.trimAllWhitespace; - public class MessageSourceBaseName { + private MessageSourceBaseName(){} + public static String[] getBaseNames(String basename){ - List result =new ArrayList(); + List result =new ArrayList<>(); //首先加载在 application.properties 中配置的 spring.messages.basename 列表 - if (StringUtils.hasText(basename)) { - //result.addAll(Arrays.asList(commaDelimitedListToStringArray(trimAllWhitespace(basename)))); - } +// if (StringUtils.hasText(basename)) { +// result.addAll(Arrays.asList(commaDelimitedListToStringArray(trimAllWhitespace(basename)))); +// } // 然后加载国际化消息插件 List messages = PluginManager.getInstance().getMessages(); if(messages!=null && !messages.isEmpty()){ diff --git a/io.sc.platform.core/src/main/java/io/sc/platform/core/i18n/PlatformResourceBundleMessageSource.java b/io.sc.platform.core/src/main/java/io/sc/platform/core/i18n/PlatformResourceBundleMessageSource.java index caebb341..d4bed734 100644 --- a/io.sc.platform.core/src/main/java/io/sc/platform/core/i18n/PlatformResourceBundleMessageSource.java +++ b/io.sc.platform.core/src/main/java/io/sc/platform/core/i18n/PlatformResourceBundleMessageSource.java @@ -9,7 +9,7 @@ public class PlatformResourceBundleMessageSource extends ResourceBundleMessageSo @Override public void reload() { - + // nothing to do } @Override diff --git a/io.sc.platform.core/src/main/java/io/sc/platform/core/plugins/PluginParser.java b/io.sc.platform.core/src/main/java/io/sc/platform/core/plugins/PluginParser.java index 2bd61a3e..5176bc44 100644 --- a/io.sc.platform.core/src/main/java/io/sc/platform/core/plugins/PluginParser.java +++ b/io.sc.platform.core/src/main/java/io/sc/platform/core/plugins/PluginParser.java @@ -3,6 +3,7 @@ package io.sc.platform.core.plugins; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.JsonNode; +import io.sc.platform.core.exception.PlatformRuntimeException; import io.sc.platform.core.util.ObjectMapper4Json; import org.springframework.core.io.Resource; @@ -25,7 +26,7 @@ public class PluginParser { urls = Thread.currentThread().getContextClassLoader().getResources(location); } catch (IOException e) { e.printStackTrace(); - throw new RuntimeException(location + " is NOT a validated plugin file.",e); + throw new PlatformRuntimeException(location + " is NOT a validated plugin file.",e); } if(urls==null){ @@ -53,7 +54,7 @@ public class PluginParser { } }catch (IOException e) { e.printStackTrace(); - throw new RuntimeException(url + " is NOT a validated plugin file.",e); + throw new PlatformRuntimeException(url + " is NOT a validated plugin file.",e); } } return result; diff --git a/io.sc.platform.core/src/main/java/io/sc/platform/core/response/ResponseWrapperBuilder.java b/io.sc.platform.core/src/main/java/io/sc/platform/core/response/ResponseWrapperBuilder.java index 1bf49c4c..156b7989 100644 --- a/io.sc.platform.core/src/main/java/io/sc/platform/core/response/ResponseWrapperBuilder.java +++ b/io.sc.platform.core/src/main/java/io/sc/platform/core/response/ResponseWrapperBuilder.java @@ -1,8 +1,10 @@ package io.sc.platform.core.response; public class ResponseWrapperBuilder { - public static ResponseWrapper success(){ - return new SuccessResponseWrapper(); + private ResponseWrapperBuilder(){} + + public static ResponseWrapper success(){ + return new SuccessResponseWrapper(); } public static ResponseWrapper success(T data){ @@ -10,30 +12,29 @@ public class ResponseWrapperBuilder { } public static ResponseWrapper success(T data,String messageI18nKey){ - SuccessResponseWrapper wrapper =new SuccessResponseWrapper(data); + SuccessResponseWrapper wrapper =new SuccessResponseWrapper(data); wrapper.setMessageI18nKey(messageI18nKey); return wrapper; } public static ResponseWrapper success(T data,String messageI18nKey,String message){ - SuccessResponseWrapper wrapper =new SuccessResponseWrapper(data); + SuccessResponseWrapper wrapper =new SuccessResponseWrapper(data); wrapper.setMessageI18nKey(messageI18nKey); wrapper.setMessage(message); return wrapper; } - public static ResponseWrapper error(Exception e){ - ErrorResponseWrapper wrapper =new ErrorResponseWrapper(e); - return wrapper; + public static ResponseWrapper error(Exception e){ + return new ErrorResponseWrapper(e); } - public static ResponseWrapper error(Exception e,String errorMessageI18nKey){ + public static ResponseWrapper error(Exception e,String errorMessageI18nKey){ ErrorResponseWrapper wrapper =new ErrorResponseWrapper(e); wrapper.setErrorMessageI18nKey(errorMessageI18nKey); return wrapper; } - public static ResponseWrapper error(Exception e,String errorMessageI18nKey,String errorMessage){ + public static ResponseWrapper error(Exception e,String errorMessageI18nKey,String errorMessage){ ErrorResponseWrapper wrapper =new ErrorResponseWrapper(e); wrapper.setErrorMessageI18nKey(errorMessageI18nKey); wrapper.setErrorMessage(errorMessage); diff --git a/io.sc.platform.core/src/main/java/io/sc/platform/core/util/BeanUtil.java b/io.sc.platform.core/src/main/java/io/sc/platform/core/util/BeanUtil.java index 53ced02f..fb0dd86d 100644 --- a/io.sc.platform.core/src/main/java/io/sc/platform/core/util/BeanUtil.java +++ b/io.sc.platform.core/src/main/java/io/sc/platform/core/util/BeanUtil.java @@ -25,7 +25,7 @@ public class BeanUtil { try { beanClass = Class.forName(beanClassName); } catch (ClassNotFoundException e) { - log.warn(beanClassName + " Class NOT found"); + log.warn("{} Class NOT found",beanClassName); return null; } try { diff --git a/io.sc.platform.core/src/main/java/io/sc/platform/core/util/CollectionUtil.java b/io.sc.platform.core/src/main/java/io/sc/platform/core/util/CollectionUtil.java index f2aaa813..5298163c 100644 --- a/io.sc.platform.core/src/main/java/io/sc/platform/core/util/CollectionUtil.java +++ b/io.sc.platform.core/src/main/java/io/sc/platform/core/util/CollectionUtil.java @@ -1,17 +1,15 @@ package io.sc.platform.core.util; +import io.sc.platform.core.util.support.MapObjectKeyConvertor; +import io.sc.platform.core.util.support.MapObjectKeyValueConvertor; import org.springframework.beans.BeanWrapper; import org.springframework.beans.BeanWrapperImpl; import org.springframework.util.StringUtils; -import io.sc.platform.core.util.support.MapObjectKeyConvertor; -import io.sc.platform.core.util.support.MapObjectKeyValueConvertor; - import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.*; -import java.util.stream.Collectors; /** * 集合工具类 @@ -219,31 +217,4 @@ public class CollectionUtil { } return map; } - - public static void println(String prefix,Collection list){ - StringBuilder sb =new StringBuilder(prefix); - sb.append("["); - if(list!=null && !list.isEmpty()) { - for (Object o : list) { - sb.append(o.toString()).append(","); - } - if(sb.length()>0){ - sb.setLength(sb.length()-1); - } - } - sb.append("]"); - System.out.println(sb.toString()); - } - - public static void println(String prefix,Map map){ - StringBuilder sb =new StringBuilder(prefix); - sb.append("[").append("\n"); - if(map!=null && !map.isEmpty()) { - for(Object key : map.keySet()){ - sb.append("\t").append("{key=").append(key).append(",").append("value=").append(map.get(key)).append("}").append("\n"); - } - } - sb.append("]"); - System.out.println(sb.toString()); - } } diff --git a/io.sc.platform.core/src/main/java/io/sc/platform/core/util/HttpServletRequestUtil.java b/io.sc.platform.core/src/main/java/io/sc/platform/core/util/HttpServletRequestUtil.java index 025bf5cf..b9ac32fe 100644 --- a/io.sc.platform.core/src/main/java/io/sc/platform/core/util/HttpServletRequestUtil.java +++ b/io.sc.platform.core/src/main/java/io/sc/platform/core/util/HttpServletRequestUtil.java @@ -9,6 +9,8 @@ import javax.servlet.http.HttpServletRequest; * HttpServletRequest 工具类 */ public class HttpServletRequestUtil { + private HttpServletRequestUtil(){} + /** * 是否是页面请求(请求头 Accept 包含 text/html) * @param request 请求头 diff --git a/io.sc.platform.core/src/main/java/io/sc/platform/core/util/IpUtil.java b/io.sc.platform.core/src/main/java/io/sc/platform/core/util/IpUtil.java index 5b2b1349..ff355564 100644 --- a/io.sc.platform.core/src/main/java/io/sc/platform/core/util/IpUtil.java +++ b/io.sc.platform.core/src/main/java/io/sc/platform/core/util/IpUtil.java @@ -1,11 +1,9 @@ package io.sc.platform.core.util; -import javax.servlet.http.HttpServletRequest; - -import inet.ipaddr.IPAddressString; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.servlet.http.HttpServletRequest; import java.io.IOException; import java.net.Inet6Address; import java.net.InetAddress; @@ -20,8 +18,11 @@ import java.util.regex.Pattern; * */ public class IpUtil { + private IpUtil(){} + private static final Logger logger = LoggerFactory.getLogger(IpUtil.class); + public static final String UNKNOW ="unknown"; public static final String UNKNOW_IP ="0.0.0.0"; private static final String ANYHOST_VALUE = "0.0.0.0"; private static final String LOCALHOST_VALUE = "127.0.0.1"; @@ -36,16 +37,16 @@ public class IpUtil { */ public static String getRemoteIp(HttpServletRequest request){ String ip =request.getHeader("x-forwarded-for"); - if(ip==null || ip.length()==0 || "unknown".equalsIgnoreCase(ip)){ + if(ip==null || ip.length()==0 || UNKNOW.equalsIgnoreCase(ip)){ ip =request.getHeader("Proxy-Client-IP"); } - if(ip==null || ip.length()==0 || "unknown".equalsIgnoreCase(ip)){ + if(ip==null || ip.length()==0 || UNKNOW.equalsIgnoreCase(ip)){ ip =request.getHeader("WL-Proxy-Client-IP"); } - if(ip==null || ip.length()==0 || "unknown".equalsIgnoreCase(ip)){ + if(ip==null || ip.length()==0 || UNKNOW.equalsIgnoreCase(ip)){ ip =request.getRemoteAddr(); } - if(ip==null || ip.length()==0 || "unknown".equalsIgnoreCase(ip)){ + if(ip==null || ip.length()==0 || UNKNOW.equalsIgnoreCase(ip)){ ip =UNKNOW_IP; } return ip; @@ -63,7 +64,7 @@ public class IpUtil { if (addressItem != null) { return addressItem.getHostAddress(); } - } catch (Throwable e) { + } catch (Exception e) { logger.error(e.getMessage(), e); } @@ -91,15 +92,15 @@ public class IpUtil { logger.error(e.getMessage(), e); } } - } catch (Throwable e) { + } catch (Exception e) { logger.error(e.getMessage(), e); } } - } catch (Throwable e) { + } catch (Exception e) { logger.error(e.getMessage(), e); } } - } catch (Throwable e) { + } catch (Exception e) { logger.error(e.getMessage(), e); } return localAddress.getHostAddress(); @@ -127,11 +128,10 @@ public class IpUtil { return false; } String name = address.getHostAddress(); - boolean result = (name != null + return (name != null && IP_PATTERN.matcher(name).matches() && !ANYHOST_VALUE.equals(name) && !LOCALHOST_VALUE.equals(name)); - return result; } private static InetAddress normalizeV6Address(Inet6Address address) { diff --git a/io.sc.platform.core/src/main/resources/io/sc/platform/core/i18n/words.properties b/io.sc.platform.core/src/main/resources/io/sc/platform/core/i18n/words.properties index c28b0a39..93e8fc4f 100644 --- a/io.sc.platform.core/src/main/resources/io/sc/platform/core/i18n/words.properties +++ b/io.sc.platform.core/src/main/resources/io/sc/platform/core/i18n/words.properties @@ -88,6 +88,7 @@ nextPage=Next Page no=No normal=Normal oldValue=Old Value +operationSuccess=Operation Sucess order=Order org=Org password=Password diff --git a/io.sc.platform.core/src/main/resources/io/sc/platform/core/i18n/words_tw_CN.properties b/io.sc.platform.core/src/main/resources/io/sc/platform/core/i18n/words_tw_CN.properties index 8e7092af..4e484314 100644 --- a/io.sc.platform.core/src/main/resources/io/sc/platform/core/i18n/words_tw_CN.properties +++ b/io.sc.platform.core/src/main/resources/io/sc/platform/core/i18n/words_tw_CN.properties @@ -10,7 +10,7 @@ bottom-right=\u53F3\u4E0B bottom=\u4E0B\u908A cancel=\u53D6\u6D88 center=\u4E2D\u5FC3 -changePassword=\u4FEE\u6539\u767B\u9304\u5BC6\u78BC +changePassword=\u4FEE\u6539\u5BC6\u78BC changeRole=\u5207\u63DB\u89D2\u8272 className=\u985E\u540D clone=\u8907\u88FD @@ -88,6 +88,7 @@ nextPage=\u4E0B\u4E00\u9801 no=\u5426 normal=\u6B63\u5E38 oldValue=\u539F\u503C +operationSuccess=\u64CD\u4F5C\u6210\u529F order=\u9806\u5E8F org=\u6A5F\u69CB password=\u5BC6\u78BC diff --git a/io.sc.platform.core/src/main/resources/io/sc/platform/core/i18n/words_zh_CN.properties b/io.sc.platform.core/src/main/resources/io/sc/platform/core/i18n/words_zh_CN.properties index a7cf418b..228aa72b 100644 --- a/io.sc.platform.core/src/main/resources/io/sc/platform/core/i18n/words_zh_CN.properties +++ b/io.sc.platform.core/src/main/resources/io/sc/platform/core/i18n/words_zh_CN.properties @@ -10,7 +10,7 @@ bottom-right=\u53F3\u4E0B bottom=\u4E0B\u8FB9 cancel=\u53D6\u6D88 center=\u4E2D\u5FC3 -changePassword=\u4FEE\u6539\u767B\u5F55\u5BC6\u7801 +changePassword=\u4FEE\u6539\u5BC6\u7801 changeRole=\u5207\u6362\u89D2\u8272 className=\u7C7B\u540D clone=\u590D\u5236 @@ -88,6 +88,7 @@ nextPage=\u4E0B\u4E00\u9875 no=\u5426 normal=\u6B63\u5E38 oldValue=\u539F\u503C +operationSuccess=\u64CD\u4F5C\u6210\u529F order=\u987A\u5E8F org=\u673A\u6784 password=\u5BC6\u7801 diff --git a/io.sc.platform.developer.doc/asciidoc/9999-appendix/java/java.adoc b/io.sc.platform.developer.doc/asciidoc/9999-appendix/java/java.adoc index 24a117d9..c0028f4a 100644 --- a/io.sc.platform.developer.doc/asciidoc/9999-appendix/java/java.adoc +++ b/io.sc.platform.developer.doc/asciidoc/9999-appendix/java/java.adoc @@ -1,5 +1,25 @@ [appendix] = JAVA +== 常用技巧 +=== 日志输出模式 +在日志输出时,在拼接字符串时,请使用字符串模版方式。 +[source,java] +---- +log.info(object + " message"); // not good +log.info("{} message", object); // good +---- + +=== 遍历 Map +[source,java] +---- +Map map =new HashMap<>(); + +for (Map.Entry entry : map.entrySet()) { + String key = entry.getKey(); + Object value = entry.getValue(); +} +---- + == Java 8 Time Api Java 8 为 Date 和 Time 引入了新的 API,以解决旧 java.util.Date 和 java.util.Calendar 的缺点。 diff --git a/io.sc.platform.security.loginform/src/main/java/io/sc/platform/security/loginform/autoconfigure/WebSecurityAutoConfiguration.java b/io.sc.platform.security.loginform/src/main/java/io/sc/platform/security/loginform/autoconfigure/WebSecurityAutoConfiguration.java index 65a82bed..b0b81942 100644 --- a/io.sc.platform.security.loginform/src/main/java/io/sc/platform/security/loginform/autoconfigure/WebSecurityAutoConfiguration.java +++ b/io.sc.platform.security.loginform/src/main/java/io/sc/platform/security/loginform/autoconfigure/WebSecurityAutoConfiguration.java @@ -7,7 +7,7 @@ import io.sc.platform.security.handler.PlatformAuthenticationEntryPoint; import io.sc.platform.security.handler.PlatformAuthenticationFailureHandler; import io.sc.platform.security.handler.PlatformAuthenticationSuccessHandler; import io.sc.platform.security.service.SecurityConfigureService; -import io.sc.platform.security.support.SecurityProperties; +import io.sc.platform.security.SecurityProperties; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.AutoConfigureOrder; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; diff --git a/io.sc.platform.security.oauth2.server.authorization/src/main/java/io/sc/platform/security/oauth2/server/authorization/configure/PlatformOauth2AuthorizationServerAutoConfiguration.java b/io.sc.platform.security.oauth2.server.authorization/src/main/java/io/sc/platform/security/oauth2/server/authorization/configure/PlatformOauth2AuthorizationServerAutoConfiguration.java index e3cbdb82..30b35a7b 100644 --- a/io.sc.platform.security.oauth2.server.authorization/src/main/java/io/sc/platform/security/oauth2/server/authorization/configure/PlatformOauth2AuthorizationServerAutoConfiguration.java +++ b/io.sc.platform.security.oauth2.server.authorization/src/main/java/io/sc/platform/security/oauth2/server/authorization/configure/PlatformOauth2AuthorizationServerAutoConfiguration.java @@ -11,7 +11,7 @@ import io.sc.platform.security.oauth2.server.authorization.bean.PlatformRegister import io.sc.platform.security.oauth2.server.authorization.configure.support.PlatformRedirectUriValidator; import io.sc.platform.security.oauth2.server.authorization.jpa.repository.ClientRepository; import io.sc.platform.security.service.SecurityConfigureService; -import io.sc.platform.security.support.SecurityProperties; +import io.sc.platform.security.SecurityProperties; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.boot.autoconfigure.AutoConfigureOrder; @@ -20,7 +20,6 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.Ordered; -import org.springframework.core.annotation.Order; import org.springframework.security.config.Customizer; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configurers.oauth2.server.resource.OAuth2ResourceServerConfigurer; @@ -32,7 +31,6 @@ import org.springframework.security.oauth2.server.authorization.settings.Authori import org.springframework.security.web.SecurityFilterChain; import org.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint; import org.springframework.security.web.util.matcher.RequestMatcher; -import org.springframework.web.filter.OncePerRequestFilter; import java.io.IOException; import java.security.KeyPair; diff --git a/io.sc.platform.security.oauth2.server.authorization/src/main/java/io/sc/platform/security/oauth2/server/authorization/configure/support/PlatformSecurityProperties.java b/io.sc.platform.security.oauth2.server.authorization/src/main/java/io/sc/platform/security/oauth2/server/authorization/configure/support/PlatformSecurityProperties.java deleted file mode 100644 index 6bca87e0..00000000 --- a/io.sc.platform.security.oauth2.server.authorization/src/main/java/io/sc/platform/security/oauth2/server/authorization/configure/support/PlatformSecurityProperties.java +++ /dev/null @@ -1,154 +0,0 @@ -package io.sc.platform.security.oauth2.server.authorization.configure.support; - -import org.springframework.boot.context.properties.ConfigurationProperties; - -@ConfigurationProperties("platform.security") -public class PlatformSecurityProperties { - private String userInfoUrl ="/api/user-info"; - private final FormLogin formLogin = new FormLogin(); - private final Logout logout = new Logout(); - private final Oauth2 oauth2 = new Oauth2(); - private final Rsa rsa = new Rsa(); - - public String getUserInfoUrl() { - return userInfoUrl; - } - - public void setUserInfoUrl(String userInfoUrl) { - this.userInfoUrl = userInfoUrl; - } - - public FormLogin getFormLogin() { - return formLogin; - } - - public Logout getLogout() { - return logout; - } - - public Oauth2 getOauth2() { - return oauth2; - } - - public Rsa getRsa() { - return rsa; - } - - public static class FormLogin { - private String loginPage ="/login"; - private String loginProcessingUrl ="/login"; - private String failureUrl ="/login?error"; - - public String getLoginPage() { - return loginPage; - } - - public void setLoginPage(String loginPage) { - this.loginPage = loginPage; - } - - public String getLoginProcessingUrl() { - return loginProcessingUrl; - } - - public void setLoginProcessingUrl(String loginProcessingUrl) { - this.loginProcessingUrl = loginProcessingUrl; - } - - public String getFailureUrl() { - return failureUrl; - } - - public void setFailureUrl(String failureUrl) { - this.failureUrl = failureUrl; - } - } - - public static class Logout { - private String logoutUrl ="/oauth2/logout"; - private String logoutSuccessUrl ="/"; - - public String getLogoutUrl() { - return logoutUrl; - } - - public void setLogoutUrl(String logoutUrl) { - this.logoutUrl = logoutUrl; - } - - public String getLogoutSuccessUrl() { - return logoutSuccessUrl; - } - - public void setLogoutSuccessUrl(String logoutSuccessUrl) { - this.logoutSuccessUrl = logoutSuccessUrl; - } - } - - public static class Oauth2 { - private final AuthorizationServer authorizationServer =new AuthorizationServer(); - - public AuthorizationServer getAuthorizationServer() { - return authorizationServer; - } - } - - public static class AuthorizationServer { - private String issuerUri ="http://localhost:8080"; - private String jwkKeyId ="io.sc.platform.security.oauth2.server.keyId"; - private final RedirectUriValidator redirectUriValidator = new RedirectUriValidator(); - - public String getIssuerUri() { - return issuerUri; - } - - public void setIssuerUri(String issuerUri) { - this.issuerUri = issuerUri; - } - - public String getJwkKeyId() { - return jwkKeyId; - } - - public void setJwkKeyId(String jwkKeyId) { - this.jwkKeyId = jwkKeyId; - } - - public RedirectUriValidator getRedirectUriValidator() { - return redirectUriValidator; - } - } - - public static class RedirectUriValidator { - private boolean enable =true; - - public boolean isEnable() { - return enable; - } - - public void setEnable(boolean enable) { - this.enable = enable; - } - } - - public static class Rsa { - private String publicKeyLocation ="classpath:/io/sc/platform/security/publicKey.txt"; - private String privateKeyLocation ="classpath:/io/sc/platform/security/privateKey.txt"; - - public String getPublicKeyLocation() { - return publicKeyLocation; - } - - public void setPublicKeyLocation(String publicKeyLocation) { - this.publicKeyLocation = publicKeyLocation; - } - - public String getPrivateKeyLocation() { - return privateKeyLocation; - } - - public void setPrivateKeyLocation(String privateKeyLocation) { - this.privateKeyLocation = privateKeyLocation; - } - } -} diff --git a/io.sc.platform.security.oauth2.server.resource/src/main/java/io/sc/platform/security/oauth2/server/resource/configure/PlatformOauth2ResourceServerAutoConfiguration.java b/io.sc.platform.security.oauth2.server.resource/src/main/java/io/sc/platform/security/oauth2/server/resource/configure/PlatformOauth2ResourceServerAutoConfiguration.java index bda80e6e..c0a35981 100644 --- a/io.sc.platform.security.oauth2.server.resource/src/main/java/io/sc/platform/security/oauth2/server/resource/configure/PlatformOauth2ResourceServerAutoConfiguration.java +++ b/io.sc.platform.security.oauth2.server.resource/src/main/java/io/sc/platform/security/oauth2/server/resource/configure/PlatformOauth2ResourceServerAutoConfiguration.java @@ -3,7 +3,7 @@ package io.sc.platform.security.oauth2.server.resource.configure; import io.sc.platform.core.service.RuntimeService; import io.sc.platform.security.service.SecurityConfigureService; -import io.sc.platform.security.support.SecurityProperties; +import io.sc.platform.security.SecurityProperties; import org.springframework.boot.autoconfigure.AutoConfigureOrder; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; diff --git a/io.sc.platform.security.oauth2.server.resource/src/main/java/io/sc/platform/security/oauth2/server/resource/configure/support/PlatformJwtAuthenticationConverter.java b/io.sc.platform.security.oauth2.server.resource/src/main/java/io/sc/platform/security/oauth2/server/resource/configure/support/PlatformJwtAuthenticationConverter.java index 80063a72..258231fd 100644 --- a/io.sc.platform.security.oauth2.server.resource/src/main/java/io/sc/platform/security/oauth2/server/resource/configure/support/PlatformJwtAuthenticationConverter.java +++ b/io.sc.platform.security.oauth2.server.resource/src/main/java/io/sc/platform/security/oauth2/server/resource/configure/support/PlatformJwtAuthenticationConverter.java @@ -2,7 +2,7 @@ package io.sc.platform.security.oauth2.server.resource.configure.support; import com.nimbusds.jose.shaded.json.JSONArray; import com.nimbusds.jose.shaded.json.JSONObject; -import io.sc.platform.security.support.SecurityClaimNames; +import io.sc.platform.security.SecurityClaimNames; import io.sc.platform.security.support.SecurityRole; import io.sc.platform.security.support.SecurityUser; import io.sc.platform.security.util.SecurityUtil; diff --git a/io.sc.platform.security/src/main/java/io/sc/platform/security/support/SecurityClaimNames.java b/io.sc.platform.security/src/main/java/io/sc/platform/security/SecurityClaimNames.java similarity index 98% rename from io.sc.platform.security/src/main/java/io/sc/platform/security/support/SecurityClaimNames.java rename to io.sc.platform.security/src/main/java/io/sc/platform/security/SecurityClaimNames.java index bcefeec4..245537cd 100644 --- a/io.sc.platform.security/src/main/java/io/sc/platform/security/support/SecurityClaimNames.java +++ b/io.sc.platform.security/src/main/java/io/sc/platform/security/SecurityClaimNames.java @@ -1,4 +1,4 @@ -package io.sc.platform.security.support; +package io.sc.platform.security; public class SecurityClaimNames { public static final class User { diff --git a/io.sc.platform.security/src/main/java/io/sc/platform/security/support/SecurityProperties.java b/io.sc.platform.security/src/main/java/io/sc/platform/security/SecurityProperties.java similarity index 98% rename from io.sc.platform.security/src/main/java/io/sc/platform/security/support/SecurityProperties.java rename to io.sc.platform.security/src/main/java/io/sc/platform/security/SecurityProperties.java index ff45d653..23c66dd9 100644 --- a/io.sc.platform.security/src/main/java/io/sc/platform/security/support/SecurityProperties.java +++ b/io.sc.platform.security/src/main/java/io/sc/platform/security/SecurityProperties.java @@ -1,4 +1,4 @@ -package io.sc.platform.security.support; +package io.sc.platform.security; import org.springframework.boot.context.properties.ConfigurationProperties; diff --git a/io.sc.platform.security/src/main/java/io/sc/platform/security/autoconfigure/PlatformWebSecurityAutoConfiguration.java b/io.sc.platform.security/src/main/java/io/sc/platform/security/autoconfigure/PlatformWebSecurityAutoConfiguration.java index b2e95b02..9d6af325 100644 --- a/io.sc.platform.security/src/main/java/io/sc/platform/security/autoconfigure/PlatformWebSecurityAutoConfiguration.java +++ b/io.sc.platform.security/src/main/java/io/sc/platform/security/autoconfigure/PlatformWebSecurityAutoConfiguration.java @@ -2,6 +2,7 @@ package io.sc.platform.security.autoconfigure; import io.sc.platform.security.autoconfigure.support.EncodePasswordAuthenticationProvider; import io.sc.platform.security.service.impl.UserDetailsServiceImpl; +import org.apache.catalina.security.SecurityConfig; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.context.annotation.Bean; diff --git a/io.sc.platform.security/src/main/java/io/sc/platform/security/util/SecurityUtil.java b/io.sc.platform.security/src/main/java/io/sc/platform/security/util/SecurityUtil.java index d86bf959..c3b35a3a 100644 --- a/io.sc.platform.security/src/main/java/io/sc/platform/security/util/SecurityUtil.java +++ b/io.sc.platform.security/src/main/java/io/sc/platform/security/util/SecurityUtil.java @@ -7,7 +7,7 @@ import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.util.Assert; import io.sc.platform.core.util.StringUtil; -import io.sc.platform.security.support.SecurityClaimNames; +import io.sc.platform.security.SecurityClaimNames; import io.sc.platform.security.support.SecurityRole; import io.sc.platform.security.support.SecurityUser; diff --git a/io.sc.platform.system.frontend/package.json b/io.sc.platform.system.frontend/package.json index 7f376df8..3f1673e7 100644 --- a/io.sc.platform.system.frontend/package.json +++ b/io.sc.platform.system.frontend/package.json @@ -78,7 +78,7 @@ "luckyexcel": "1.0.1", "mockjs": "1.1.0", "pinia": "2.1.7", - "platform-core": "8.1.60", + "platform-core": "8.1.61", "quasar": "2.14.2", "tailwindcss": "3.4.0", "vue": "3.4.3", diff --git a/io.sc.platform.system.frontend/src/i18n/messages.json b/io.sc.platform.system.frontend/src/i18n/messages.json index 0abe591e..04731a7c 100644 --- a/io.sc.platform.system.frontend/src/i18n/messages.json +++ b/io.sc.platform.system.frontend/src/i18n/messages.json @@ -17,17 +17,24 @@ "menu.system.monitor.resources" : "Resources", "menu.system.license" : "License", - "system.user.gridTitle":"User List", "system.role.gridTitle":"Role List", "system.org.gridTitle":"Org Tree", "system.announcement.gridTitle":"Announcement List", "system.monitor.auditlog.gridTitle":"Audit Log List", + "system.user.grid.title":"User List", "system.user.action.addUser":"Add User", "system.user.action.addAllUser":"Add All User", "system.user.action.removeUser":"Remove User", "system.user.action.removeAllUser":"Remove All User", "system.user.action.setPassword":"Set Password", + "system.user.action.setAllPassword":"Set All Password", + "system.user.action.resetPassword":"Reset Password", + "system.user.action.resetAllPassword":"Reset All Password", + "system.user.confirm.resetPassword":"Are you sure to reset the user's password?", + "system.user.confirm.resetAllPassword":"Are you sure to reset ALL user's password?", + "system.user.entity.title":"User List", + "system.role.action.addRole":"Add Role", "system.role.action.addAllRole":"Add All Role", diff --git a/io.sc.platform.system.frontend/src/i18n/messages_tw_CN.json b/io.sc.platform.system.frontend/src/i18n/messages_tw_CN.json index 41b1aa77..46ab563a 100644 --- a/io.sc.platform.system.frontend/src/i18n/messages_tw_CN.json +++ b/io.sc.platform.system.frontend/src/i18n/messages_tw_CN.json @@ -17,17 +17,22 @@ "menu.system.monitor.resources" : "系統資源", "menu.system.license" : "許可證管理", - "system.user.gridTitle":"用戶列表", "system.role.gridTitle":"角色列表", "system.org.gridTitle":"機構樹", "system.announcement.gridTitle":"公告列表", "system.monitor.auditlog.gridTitle":"審計日誌列表", + "system.user.grid.title":"用戶列表", "system.user.action.addUser":"添加用户", "system.user.action.addAllUser":"添加所有用户", "system.user.action.removeUser":"移除用户", "system.user.action.removeAllUser":"移除所有用户", - "system.user.action.setPassword":"修改密碼", + "system.user.action.setPassword":"設置密碼", + "system.user.action.setAllPassword":"設置所有密碼", + "system.user.action.resetPassword":"重置密碼", + "system.user.action.resetAllPassword":"重置所有密碼", + "system.user.confirm.resetPassword":"您確認要重置用戶密碼嗎?", + "system.user.confirm.resetAllPassword":"您確認要重置所有用戶密碼嗎?", "system.role.action.addRole":"添加角色", "system.role.action.addAllRole":"添加所有角色", diff --git a/io.sc.platform.system.frontend/src/i18n/messages_zh_CN.json b/io.sc.platform.system.frontend/src/i18n/messages_zh_CN.json index 5344042a..3c657f09 100644 --- a/io.sc.platform.system.frontend/src/i18n/messages_zh_CN.json +++ b/io.sc.platform.system.frontend/src/i18n/messages_zh_CN.json @@ -17,17 +17,23 @@ "menu.system.monitor.resources" : "系统资源", "menu.system.license" : "许可证管理", - "system.user.gridTitle":"用户列表", "system.role.gridTitle":"角色列表", "system.org.gridTitle":"机构树", "system.announcement.gridTitle":"公告列表", "system.monitor.auditlog.gridTitle":"审计日志列表", + "system.user.grid.title":"用户列表", "system.user.action.addUser":"添加用户", "system.user.action.addAllUser":"添加所有用户", "system.user.action.removeUser":"移除用户", "system.user.action.removeAllUser":"移除所有用户", - "system.user.action.setPassword":"修改密码", + "system.user.action.setPassword":"设置密码", + "system.user.action.setAllPassword":"设置所有密码", + "system.user.action.resetPassword":"重置密码", + "system.user.action.resetAllPassword":"重置所有密码", + "system.user.confirm.resetPassword":"您确定要重置用户密码吗?", + "system.user.confirm.resetAllPassword":"您确定要重置所有用户密码吗?", + "system.role.action.addRole":"添加角色", "system.role.action.addAllRole":"添加所有角色", diff --git a/io.sc.platform.system.frontend/src/views/user/ChangePasswordDialog.vue b/io.sc.platform.system.frontend/src/views/user/ChangePasswordDialog.vue deleted file mode 100644 index 77dbe203..00000000 --- a/io.sc.platform.system.frontend/src/views/user/ChangePasswordDialog.vue +++ /dev/null @@ -1,86 +0,0 @@ - - diff --git a/io.sc.platform.system.frontend/src/views/user/SetPasswordDialog.vue b/io.sc.platform.system.frontend/src/views/user/SetPasswordDialog.vue new file mode 100644 index 00000000..32d173bb --- /dev/null +++ b/io.sc.platform.system.frontend/src/views/user/SetPasswordDialog.vue @@ -0,0 +1,59 @@ + + diff --git a/io.sc.platform.system.frontend/src/views/user/User.vue b/io.sc.platform.system.frontend/src/views/user/User.vue index ba13ae92..f89d2167 100644 --- a/io.sc.platform.system.frontend/src/views/user/User.vue +++ b/io.sc.platform.system.frontend/src/views/user/User.vue @@ -1,5 +1,4 @@