From 29f54ece54850d9f86ee0c082cdcec3c9021aa31 Mon Sep 17 00:00:00 2001
From: smallbun <2689170096@qq.com>
Date: Sun, 27 Aug 2023 20:21:15 +0800
Subject: [PATCH] =?UTF-8?q?:zap:=20=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../otp/mail/configurer/package-info.java | 22 ++-----------------
.../exception/MailMessageSendException.java | 11 ++++++++++
.../exception/SmsMessageSendException.java | 10 +++++++++
.../src/components/IconFont/lib/iconfont.js | 2 +-
.../components/Config/AliPayOauthConfig.tsx | 9 --------
.../components/Config/GiteeOauthConfig.tsx | 6 -----
.../components/Config/GithubOauthConfig.tsx | 6 -----
.../authn/IdentityProvider/locales/zh-CN.ts | 20 +++--------------
.../core/mq/NoticeMessageListener.java | 5 ++---
.../src/components/IconFont/lib/iconfont.js | 2 +-
10 files changed, 30 insertions(+), 63 deletions(-)
rename eiam-common/src/main/java/cn/topiam/employee/common/exception/MessageSendException.java => eiam-authentication/eiam-authentication-mail/src/main/java/cn/topiam/employee/authentication/otp/mail/configurer/package-info.java (58%)
diff --git a/eiam-common/src/main/java/cn/topiam/employee/common/exception/MessageSendException.java b/eiam-authentication/eiam-authentication-mail/src/main/java/cn/topiam/employee/authentication/otp/mail/configurer/package-info.java
similarity index 58%
rename from eiam-common/src/main/java/cn/topiam/employee/common/exception/MessageSendException.java
rename to eiam-authentication/eiam-authentication-mail/src/main/java/cn/topiam/employee/authentication/otp/mail/configurer/package-info.java
index 6fe0ac93..43024235 100644
--- a/eiam-common/src/main/java/cn/topiam/employee/common/exception/MessageSendException.java
+++ b/eiam-authentication/eiam-authentication-mail/src/main/java/cn/topiam/employee/authentication/otp/mail/configurer/package-info.java
@@ -1,5 +1,5 @@
/*
- * eiam-common - Employee Identity and Access Management
+ * eiam-authentication-mail - Employee Identity and Access Management
* Copyright © 2022-Present Jinan Yuanchuang Network Technology Co., Ltd. (support@topiam.cn)
*
* This program is free software: you can redistribute it and/or modify
@@ -15,22 +15,4 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
-package cn.topiam.employee.common.exception;
-
-import org.springframework.http.HttpStatus;
-
-import cn.topiam.employee.support.exception.TopIamException;
-
-/**
- * 消息 发送异常
- *
- * @author TopIAM
- * Created by support@topiam.cn on 2022/8/7 23:03
- */
-public class MessageSendException extends TopIamException {
-
- public MessageSendException(Throwable throwable) {
- super(throwable, "message_send_error", "发送短信/邮件消息失败", HttpStatus.INTERNAL_SERVER_ERROR);
- }
-
-}
+package cn.topiam.employee.authentication.otp.mail.configurer;
\ No newline at end of file
diff --git a/eiam-common/src/main/java/cn/topiam/employee/common/exception/MailMessageSendException.java b/eiam-common/src/main/java/cn/topiam/employee/common/exception/MailMessageSendException.java
index 91c799b7..35e084fa 100644
--- a/eiam-common/src/main/java/cn/topiam/employee/common/exception/MailMessageSendException.java
+++ b/eiam-common/src/main/java/cn/topiam/employee/common/exception/MailMessageSendException.java
@@ -17,6 +17,8 @@
*/
package cn.topiam.employee.common.exception;
+import org.springframework.http.HttpStatus;
+
import cn.topiam.employee.support.exception.TopIamException;
/**
@@ -26,6 +28,15 @@ import cn.topiam.employee.support.exception.TopIamException;
* Created by support@topiam.cn on 2021/9/25 21:43
*/
public class MailMessageSendException extends TopIamException {
+
+ public MailMessageSendException() {
+ super("message_send_error", "发送邮件消息失败", HttpStatus.INTERNAL_SERVER_ERROR);
+ }
+
+ public MailMessageSendException(Throwable cause) {
+ super(cause, "message_send_error", "发送邮件消息失败", HttpStatus.INTERNAL_SERVER_ERROR);
+ }
+
/**
* Constructs a new runtime exception with the specified detail message.
* The cause is not initialized, and may subsequently be initialized by a
diff --git a/eiam-common/src/main/java/cn/topiam/employee/common/exception/SmsMessageSendException.java b/eiam-common/src/main/java/cn/topiam/employee/common/exception/SmsMessageSendException.java
index 16b0281c..3d6dd242 100644
--- a/eiam-common/src/main/java/cn/topiam/employee/common/exception/SmsMessageSendException.java
+++ b/eiam-common/src/main/java/cn/topiam/employee/common/exception/SmsMessageSendException.java
@@ -17,6 +17,8 @@
*/
package cn.topiam.employee.common.exception;
+import org.springframework.http.HttpStatus;
+
import cn.topiam.employee.support.exception.TopIamException;
/**
@@ -26,6 +28,14 @@ import cn.topiam.employee.support.exception.TopIamException;
* Created by support@topiam.cn on 2023/8/26 18:01
*/
public class SmsMessageSendException extends TopIamException {
+ public SmsMessageSendException() {
+ super("message_send_error", "发送短信消息失败", HttpStatus.INTERNAL_SERVER_ERROR);
+ }
+
+ public SmsMessageSendException(Throwable cause) {
+ super(cause, "message_send_error", "发送短信消息失败", HttpStatus.INTERNAL_SERVER_ERROR);
+ }
+
/**
* Constructs a new runtime exception with the specified detail message.
* The cause is not initialized, and may subsequently be initialized by a
diff --git a/eiam-console/src/main/console-fe/src/components/IconFont/lib/iconfont.js b/eiam-console/src/main/console-fe/src/components/IconFont/lib/iconfont.js
index 47c2c219..90ee4748 100644
--- a/eiam-console/src/main/console-fe/src/components/IconFont/lib/iconfont.js
+++ b/eiam-console/src/main/console-fe/src/components/IconFont/lib/iconfont.js
@@ -15,4 +15,4 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
-window._iconfont_svg_string_3203993='',function(c){var l=(l=document.getElementsByTagName("script"))[l.length-1],a=l.getAttribute("data-injectcss"),l=l.getAttribute("data-disable-injectsvg");if(!l){var h,t,i,p,m,d=function(l,a){a.parentNode.insertBefore(l,a)};if(a&&!c.__iconfont__svg__cssinject__){c.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(l){console&&console.log(l)}}h=function(){var l,a=document.createElement("div");a.innerHTML=c._iconfont_svg_string_3203993,(a=a.getElementsByTagName("svg")[0])&&(a.setAttribute("aria-hidden","true"),a.style.position="absolute",a.style.width=0,a.style.height=0,a.style.overflow="hidden",a=a,(l=document.body).firstChild?d(a,l.firstChild):l.appendChild(a))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(h,0):(t=function(){document.removeEventListener("DOMContentLoaded",t,!1),h()},document.addEventListener("DOMContentLoaded",t,!1)):document.attachEvent&&(i=h,p=c.document,m=!1,o(),p.onreadystatechange=function(){"complete"==p.readyState&&(p.onreadystatechange=null,z())})}function z(){m||(m=!0,i())}function o(){try{p.documentElement.doScroll("left")}catch(l){return void setTimeout(o,50)}z()}}(window);
+window._iconfont_svg_string_3203993='',function(c){var l=(l=document.getElementsByTagName("script"))[l.length-1],a=l.getAttribute("data-injectcss"),l=l.getAttribute("data-disable-injectsvg");if(!l){var h,t,i,p,m,d=function(l,a){a.parentNode.insertBefore(l,a)};if(a&&!c.__iconfont__svg__cssinject__){c.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(l){console&&console.log(l)}}h=function(){let l,a=document.createElement("div");a.innerHTML=c._iconfont_svg_string_3203993,(a=a.getElementsByTagName("svg")[0])&&(a.setAttribute("aria-hidden","true"),a.style.position="absolute",a.style.width=0,a.style.height=0,a.style.overflow="hidden",a=a,(l=document.body).firstChild?d(a,l.firstChild):l.appendChild(a))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(h,0):(t=function(){document.removeEventListener("DOMContentLoaded",t,!1),h()},document.addEventListener("DOMContentLoaded",t,!1)):document.attachEvent&&(i=h,p=c.document,m=!1,o(),p.onreadystatechange=function(){"complete"==p.readyState&&(p.onreadystatechange=null,z())})}function z(){m||(m=!0,i())}function o(){try{p.documentElement.doScroll("left")}catch(l){return void setTimeout(o,50)}z()}}(window);
diff --git a/eiam-console/src/main/console-fe/src/pages/authn/IdentityProvider/components/Config/AliPayOauthConfig.tsx b/eiam-console/src/main/console-fe/src/pages/authn/IdentityProvider/components/Config/AliPayOauthConfig.tsx
index bcd9937e..a83ed81e 100644
--- a/eiam-console/src/main/console-fe/src/pages/authn/IdentityProvider/components/Config/AliPayOauthConfig.tsx
+++ b/eiam-console/src/main/console-fe/src/pages/authn/IdentityProvider/components/Config/AliPayOauthConfig.tsx
@@ -40,9 +40,6 @@ const QqOauthConfig = (props: { isCreate: boolean }) => {
placeholder={intl.formatMessage({
id: 'pages.authn.identity_provider.config.alipay_oauth.app_id.placeholder',
})}
- extra={intl.formatMessage({
- id: 'pages.authn.identity_provider.config.alipay_oauth.app_id.extra',
- })}
/>
{
placeholder={intl.formatMessage({
id: 'pages.authn.identity_provider.config.alipay_oauth.app_private_key.placeholder',
})}
- extra={intl.formatMessage({
- id: 'pages.authn.identity_provider.config.alipay_oauth.app_private_key.extra',
- })}
fieldProps={{ autoComplete: 'off' }}
/>
{
placeholder={intl.formatMessage({
id: 'pages.authn.identity_provider.config.alipay_oauth.alipay_public_key.placeholder',
})}
- extra={intl.formatMessage({
- id: 'pages.authn.identity_provider.config.alipay_oauth.alipay_public_key.extra',
- })}
fieldProps={{ autoComplete: 'off' }}
/>
{!isCreate && }
diff --git a/eiam-console/src/main/console-fe/src/pages/authn/IdentityProvider/components/Config/GiteeOauthConfig.tsx b/eiam-console/src/main/console-fe/src/pages/authn/IdentityProvider/components/Config/GiteeOauthConfig.tsx
index 56393d21..62f43f62 100644
--- a/eiam-console/src/main/console-fe/src/pages/authn/IdentityProvider/components/Config/GiteeOauthConfig.tsx
+++ b/eiam-console/src/main/console-fe/src/pages/authn/IdentityProvider/components/Config/GiteeOauthConfig.tsx
@@ -40,9 +40,6 @@ const GiteeOauthConfig = (props: { isCreate: boolean }) => {
placeholder={intl.formatMessage({
id: 'pages.authn.identity_provider.config.gitee_oauth.client_id.placeholder',
})}
- extra={intl.formatMessage({
- id: 'pages.authn.identity_provider.config.gitee_oauth.client_id.extra',
- })}
/>
{
placeholder={intl.formatMessage({
id: 'pages.authn.identity_provider.config.gitee_oauth.client_secret.placeholder',
})}
- extra={intl.formatMessage({
- id: 'pages.authn.identity_provider.config.gitee_oauth.client_secret.extra',
- })}
fieldProps={{ autoComplete: 'off' }}
/>
{!isCreate && }
diff --git a/eiam-console/src/main/console-fe/src/pages/authn/IdentityProvider/components/Config/GithubOauthConfig.tsx b/eiam-console/src/main/console-fe/src/pages/authn/IdentityProvider/components/Config/GithubOauthConfig.tsx
index ea74aab4..187340b4 100644
--- a/eiam-console/src/main/console-fe/src/pages/authn/IdentityProvider/components/Config/GithubOauthConfig.tsx
+++ b/eiam-console/src/main/console-fe/src/pages/authn/IdentityProvider/components/Config/GithubOauthConfig.tsx
@@ -40,9 +40,6 @@ const QqOauthConfig = (props: { isCreate: boolean }) => {
placeholder={intl.formatMessage({
id: 'pages.authn.identity_provider.config.github_oauth.client_id.placeholder',
})}
- extra={intl.formatMessage({
- id: 'pages.authn.identity_provider.config.github_oauth.client_id.extra',
- })}
/>
{
placeholder={intl.formatMessage({
id: 'pages.authn.identity_provider.config.github_oauth.client_secret.placeholder',
})}
- extra={intl.formatMessage({
- id: 'pages.authn.identity_provider.config.github_oauth.client_secret.extra',
- })}
fieldProps={{ autoComplete: 'off' }}
/>
{!isCreate && }
diff --git a/eiam-console/src/main/console-fe/src/pages/authn/IdentityProvider/locales/zh-CN.ts b/eiam-console/src/main/console-fe/src/pages/authn/IdentityProvider/locales/zh-CN.ts
index cd109ab9..6f71ab17 100644
--- a/eiam-console/src/main/console-fe/src/pages/authn/IdentityProvider/locales/zh-CN.ts
+++ b/eiam-console/src/main/console-fe/src/pages/authn/IdentityProvider/locales/zh-CN.ts
@@ -65,33 +65,19 @@ export default {
'pages.authn.identity_provider.config.gitee_oauth.client_secret': '客户端秘钥',
'pages.authn.identity_provider.config.gitee_oauth.client_secret.placeholder':
'请填写ClientSecret',
- 'pages.authn.identity_provider.config.gitee_oauth.client_id.extra': 'Gitee应用的Client ID',
- 'pages.authn.identity_provider.config.gitee_oauth.client_secret.extra':
- 'Gitee应用生成的Client secret',
- 'pages.authn.identity_provider.config.github_oauth.client_id':
- '客户端ID',
+ 'pages.authn.identity_provider.config.github_oauth.client_id': '客户端ID',
'pages.authn.identity_provider.config.github_oauth.client_id.placeholder': '请填写Client ID',
- 'pages.authn.identity_provider.config.github_oauth.client_secret':
- '客户端秘钥',
+ 'pages.authn.identity_provider.config.github_oauth.client_secret': '客户端秘钥',
'pages.authn.identity_provider.config.github_oauth.client_secret.placeholder':
'请填写Client Secret',
- 'pages.authn.identity_provider.config.github_oauth.client_id.extra': 'GitHub应用的Client ID',
- 'pages.authn.identity_provider.config.github_oauth.client_secret.extra':
- 'GitHub应用生成的Client secret',
'pages.authn.identity_provider.config.alipay_oauth.app_id': '应用ID',
'pages.authn.identity_provider.config.alipay_oauth.app_id.placeholder': '请填写应用ID',
- 'pages.authn.identity_provider.config.alipay_oauth.app_id.extra': 'xxxxxxxxx',
- 'pages.authn.identity_provider.config.alipay_oauth.app_id.placeholder.extra': 'xxxxxxx',
'pages.authn.identity_provider.config.alipay_oauth.app_private_key': '应用私钥',
- 'pages.authn.identity_provider.config.alipay_oauth.app_private_key.placeholder':
- '请填写应用私钥',
- 'pages.authn.identity_provider.config.alipay_oauth.app_private_key.extra': 'xxxxxxxxxxx',
+ 'pages.authn.identity_provider.config.alipay_oauth.app_private_key.placeholder': '请填写应用私钥',
'pages.authn.identity_provider.config.alipay_oauth.alipay_public_key': '支付宝公钥',
'pages.authn.identity_provider.config.alipay_oauth.alipay_public_key.placeholder':
'请填写支付宝公钥',
- 'pages.authn.identity_provider.config.alipay_oauth.alipay_public_key.extra': 'xxxxxxxxxxxxx',
-
'pages.authn.identity_provider.config.wechat_scan_code.app_id.extra':
'微信扫码登录开发申请获取的AppId',
'pages.authn.identity_provider.config.wechat_scan_code.app_id.placeholder': '请填写获取的AppId',
diff --git a/eiam-core/src/main/java/cn/topiam/employee/core/mq/NoticeMessageListener.java b/eiam-core/src/main/java/cn/topiam/employee/core/mq/NoticeMessageListener.java
index 3da89a1a..df1e9749 100644
--- a/eiam-core/src/main/java/cn/topiam/employee/core/mq/NoticeMessageListener.java
+++ b/eiam-core/src/main/java/cn/topiam/employee/core/mq/NoticeMessageListener.java
@@ -42,7 +42,6 @@ import cn.topiam.employee.common.entity.setting.MailTemplateEntity;
import cn.topiam.employee.common.enums.MailType;
import cn.topiam.employee.common.enums.MessageCategory;
import cn.topiam.employee.common.exception.MailMessageSendException;
-import cn.topiam.employee.common.exception.MessageSendException;
import cn.topiam.employee.common.exception.SmsMessageSendException;
import cn.topiam.employee.common.message.mail.MailNoneProviderSend;
import cn.topiam.employee.common.message.mail.MailProviderSend;
@@ -183,7 +182,7 @@ public class NoticeMessageListener extends AbstractMessageListener {
}
} catch (Exception e) {
log.error("发送短信消息异常 params:{}, error: {}", smsParam, e.getMessage());
- throw new MessageSendException(e);
+ throw new SmsMessageSendException(e);
}
}
@@ -254,7 +253,7 @@ public class NoticeMessageListener extends AbstractMessageListener {
mailSendRecordRepository.save(record);
} catch (Exception e) {
log.error("邮件信息发送失败: {}", e.getMessage());
- throw new MailMessageSendException("邮件信息发送失败!", e);
+ throw new MailMessageSendException(e);
}
}
diff --git a/eiam-portal/src/main/portal-fe/src/components/IconFont/lib/iconfont.js b/eiam-portal/src/main/portal-fe/src/components/IconFont/lib/iconfont.js
index ba64b0ec..f1d6a0dd 100644
--- a/eiam-portal/src/main/portal-fe/src/components/IconFont/lib/iconfont.js
+++ b/eiam-portal/src/main/portal-fe/src/components/IconFont/lib/iconfont.js
@@ -15,4 +15,4 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
-window._iconfont_svg_string_3203993='',function(c){var l=(l=document.getElementsByTagName("script"))[l.length-1],a=l.getAttribute("data-injectcss"),l=l.getAttribute("data-disable-injectsvg");if(!l){var h,t,i,p,m,d=function(l,a){a.parentNode.insertBefore(l,a)};if(a&&!c.__iconfont__svg__cssinject__){c.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(l){console&&console.log(l)}}h=function(){var l,a=document.createElement("div");a.innerHTML=c._iconfont_svg_string_3203993,(a=a.getElementsByTagName("svg")[0])&&(a.setAttribute("aria-hidden","true"),a.style.position="absolute",a.style.width=0,a.style.height=0,a.style.overflow="hidden",a=a,(l=document.body).firstChild?d(a,l.firstChild):l.appendChild(a))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(h,0):(t=function(){document.removeEventListener("DOMContentLoaded",t,!1),h()},document.addEventListener("DOMContentLoaded",t,!1)):document.attachEvent&&(i=h,p=c.document,m=!1,o(),p.onreadystatechange=function(){"complete"==p.readyState&&(p.onreadystatechange=null,z())})}function z(){m||(m=!0,i())}function o(){try{p.documentElement.doScroll("left")}catch(l){return void setTimeout(o,50)}z()}}(window);
+window._iconfont_svg_string_3203993='',function(c){var l=(l=document.getElementsByTagName("script"))[l.length-1],a=l.getAttribute("data-injectcss"),l=l.getAttribute("data-disable-injectsvg");if(!l){var h,t,i,p,m,d=function(l,a){a.parentNode.insertBefore(l,a)};if(a&&!c.__iconfont__svg__cssinject__){c.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(l){console&&console.log(l)}}h=function(){let l,a=document.createElement("div");a.innerHTML=c._iconfont_svg_string_3203993,(a=a.getElementsByTagName("svg")[0])&&(a.setAttribute("aria-hidden","true"),a.style.position="absolute",a.style.width=0,a.style.height=0,a.style.overflow="hidden",a=a,(l=document.body).firstChild?d(a,l.firstChild):l.appendChild(a))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(h,0):(t=function(){document.removeEventListener("DOMContentLoaded",t,!1),h()},document.addEventListener("DOMContentLoaded",t,!1)):document.attachEvent&&(i=h,p=c.document,m=!1,o(),p.onreadystatechange=function(){"complete"==p.readyState&&(p.onreadystatechange=null,z())})}function z(){m||(m=!0,i())}function o(){try{p.documentElement.doScroll("left")}catch(l){return void setTimeout(o,50)}z()}}(window);