@@ -43,12 +42,12 @@ function NoticeManager(props){
item.type_name &&
{item.type_name}
{item.settings.map((i, k) => {
- console.log(userNotification.get(item.type.substring(item.type.indexOf("::")+2)+"::"+i.key));
+ // console.log(userEmail[item.type.substring(item.type.indexOf("::")+2)+"::"+i.key]);
return (
{i.name}
-
站内信
-
邮件
+
站内信
+
邮件
)
})}
From fe1bacb98417a88453e9b72f48e48b462133716b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=B0=A2=E6=80=9D?= <2897217417@qq.com>
Date: Tue, 19 Oct 2021 10:26:36 +0800
Subject: [PATCH 3/5] =?UTF-8?q?=E9=80=9A=E7=9F=A5=E7=AE=A1=E7=90=86+?=
=?UTF-8?q?=E5=88=A0=E9=99=A4=E5=9F=BA=E6=9C=AC=E8=B5=84=E6=96=99=E9=A1=B5?=
=?UTF-8?q?=E9=9D=A2=E7=9A=84consolo=E8=AF=AD=E5=8F=A5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../SecuritySetting/notice/manager/Index.jsx | 46 +++++++++++--------
src/forge/users/Material/Base.jsx | 1 -
2 files changed, 28 insertions(+), 19 deletions(-)
diff --git a/src/forge/SecuritySetting/notice/manager/Index.jsx b/src/forge/SecuritySetting/notice/manager/Index.jsx
index d45dc371..ca16f25e 100644
--- a/src/forge/SecuritySetting/notice/manager/Index.jsx
+++ b/src/forge/SecuritySetting/notice/manager/Index.jsx
@@ -10,26 +10,36 @@ function NoticeManager(props){
const [userNotification, setUserNotification] = useState();
const [userEmail, setUserEmail] = useState();
- function getUserSettings(){
+ function onChange(type,e,setting){
+ let notification_body = userNotification;
+ let email_body = userEmail;
+ if(type){//站内信
+ notification_body[setting] = e.target.checked;
+ }else{//邮件
+ email_body[setting] = e.target.checked;
+ }
+ axios.post(`/users/${current_user.login}/template_message_settings/update_setting.json`,{
+ setting:{
+ notification_body:notification_body,
+ email_body:email_body
+ }
+ })
+ }
+
+ useEffect(()=>{
+ axios.get("/template_message_settings.json").then(response => {
+ if (response && response.status === 200) {
+ setSettingTypes(response.data.setting_types);
+ }
+ })
axios.get(`/users/${current_user.login}/template_message_settings.json`).then((response)=>{
if(response && response.status === 200 ){
setUserEmail(response.data.email_body);
setUserNotification(response.data.notification_body);
}
})
- }
-
- useEffect(()=>{
- axios.get("/template_message_settings.json").then((response)=>{
- if(response && response.status === 200 ){
- setSettingTypes(response.data.setting_types);
- }
- })
- getUserSettings();
},[])
- console.log('settingTypes',settingTypes);
- console.log('userNotification',userNotification,'userEmail',userEmail);
return(
@@ -37,17 +47,17 @@ function NoticeManager(props){
您可以通过通知管理来选择接受通知的方式
- {settingTypes && settingTypes.map((item,key)=>{
+ {settingTypes && userNotification && userEmail && settingTypes.map((item,key)=>{
return(
- item.type_name &&
+ item.type_name &&
{item.type_name}
{item.settings.map((i, k) => {
- // console.log(userEmail[item.type.substring(item.type.indexOf("::")+2)+"::"+i.key]);
+ const setting = item.type.substring(item.type.indexOf("::")+2)+"::"+i.key;
return (
-
+
{i.name}
-
站内信
-
邮件
+
{onChange(true,e,setting)}}>站内信
+
{onChange(false,e,setting)}}>邮件
)
})}
diff --git a/src/forge/users/Material/Base.jsx b/src/forge/users/Material/Base.jsx
index f9707ab0..61a9d6f1 100644
--- a/src/forge/users/Material/Base.jsx
+++ b/src/forge/users/Material/Base.jsx
@@ -11,7 +11,6 @@ export default Form.create()(
const { getFieldDecorator, validateFields , setFieldsValue } = props && props.form;
// const { username } = props && props.match && props.match.params;
const { resetUserInfo , current_user } = props;
- console.log(props);
useEffect(()=>{
if(current_user && current_user.login){
From 31af77e7040670d30877d24976186f38b960f788 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=B0=A2=E6=80=9D?= <2897217417@qq.com>
Date: Tue, 19 Oct 2021 10:45:15 +0800
Subject: [PATCH 4/5] =?UTF-8?q?=E9=80=9A=E7=9F=A5=E7=AE=A1=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../SecuritySetting/notice/manager/Index.jsx | 20 +++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
diff --git a/src/forge/SecuritySetting/notice/manager/Index.jsx b/src/forge/SecuritySetting/notice/manager/Index.jsx
index ca16f25e..5ba82d60 100644
--- a/src/forge/SecuritySetting/notice/manager/Index.jsx
+++ b/src/forge/SecuritySetting/notice/manager/Index.jsx
@@ -23,6 +23,19 @@ function NoticeManager(props){
notification_body:notification_body,
email_body:email_body
}
+ }).then(response=>{
+ if(response && response.status === 0){
+ getUserSettings();
+ }
+ })
+ }
+
+ function getUserSettings(){
+ axios.get(`/users/${current_user.login}/template_message_settings.json`).then((response)=>{
+ if(response && response.status === 200 ){
+ setUserEmail(response.data.email_body);
+ setUserNotification(response.data.notification_body);
+ }
})
}
@@ -32,12 +45,7 @@ function NoticeManager(props){
setSettingTypes(response.data.setting_types);
}
})
- axios.get(`/users/${current_user.login}/template_message_settings.json`).then((response)=>{
- if(response && response.status === 200 ){
- setUserEmail(response.data.email_body);
- setUserNotification(response.data.notification_body);
- }
- })
+ getUserSettings();
},[])
return(
From cc62bde5b48dd34e5dc330c301e1acc24fb7cdd8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=B0=A2=E6=80=9D?= <2897217417@qq.com>
Date: Thu, 21 Oct 2021 11:02:15 +0800
Subject: [PATCH 5/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8F=90=E4=BA=A4?=
=?UTF-8?q?=E5=88=97=E8=A1=A8=E9=A1=B5=20=E6=8F=90=E4=BA=A4=E4=BF=A1?=
=?UTF-8?q?=E6=81=AF=E5=A4=9A=E8=A1=8C=E6=A0=B7=E5=BC=8F=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/forge/Main/list.scss | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/forge/Main/list.scss b/src/forge/Main/list.scss
index 83b4d5ee..59589fb6 100644
--- a/src/forge/Main/list.scss
+++ b/src/forge/Main/list.scss
@@ -734,7 +734,9 @@ a.color-grey-ccc:hover{
border: 1px solid rgba(42, 97, 255, 0.23);
border-radius: 4px;
margin-left: 16px;
- align-items: center;
+ & .treecopy{
+ margin-top: 20px;
+ }
& .markdown-body table{
background: #FAFCFF;
}