fangmingyue 1 rok temu
rodzic
commit
3f8392c6ef

BIN
public/img/step4.jpg Wyświetl plik


BIN
public/img/step5.jpg Wyświetl plik


BIN
public/img/step6.jpg Wyświetl plik


+ 6
- 0
src/layouts/AuthLayout/RequireLogin.jsx Wyświetl plik

@@ -1,6 +1,7 @@
1 1
 import React, { useState, useEffect } from "react";
2 2
 import { useNavigate } from "react-router-dom";
3 3
 import { useModel } from "@/store";
4
+import { currentUser } from "@/services/login";
4 5
 
5 6
 export default (props) => {
6 7
   const { user, getCurrentUser } = useModel("user");
@@ -18,6 +19,11 @@ export default (props) => {
18 19
           setUserStatus(-1);
19 20
         });
20 21
     }
22
+    currentUser().then((res) => {
23
+      if (!res.user?.email) {
24
+        navigate("/bindEmail");
25
+      }
26
+    });
21 27
   }, []);
22 28
 
23 29
   useEffect(() => {

+ 11
- 0
src/locale/zh.json Wyświetl plik

@@ -154,6 +154,10 @@
154 154
     "btnText4": "去提交",
155 155
     "text4": "请结合您的实际业务运营情况及时提交新的业务场景",
156 156
 
157
+    "title5": "启用谷歌身份验证器",
158
+    "btnText5": "去启用",
159
+    "text5": "为了您的账户安全,请启用谷歌身份验证器(Google Authenticator)",
160
+
157 161
     "emailTitle": "修改邮箱",
158 162
     "emailInput1": "原始邮箱",
159 163
     "emailInput2": "新邮箱",
@@ -182,5 +186,12 @@
182 186
     "title4": "填写企业受益所有人信息",
183 187
     "title5": "人脸识别",
184 188
     "title6": "确认提交"
189
+  },
190
+  "bindEmail": {
191
+    "extra": "请绑定您的邮箱",
192
+    "label": "邮箱",
193
+    "placeholder": "请输入邮箱",
194
+    "message": "请输入邮箱",
195
+    "submit": "确定"
185 196
   }
186 197
 }

+ 6
- 5
src/pages/accountsettings/components/ChangeModalEmail.jsx Wyświetl plik

@@ -10,18 +10,19 @@ import { useNavigate } from "react-router-dom";
10 10
 import { useTranslation } from 'react-i18next';
11 11
 
12 12
 export default (props) => {
13
-  const { opEmail, setOpEmail } = props;
13
+  const { opEmail, setOpEmail, setEmail, hideEmail } = props;
14 14
   const navigate = useNavigate();
15 15
   const { t } = useTranslation();
16 16
 
17 17
   const onFinish = async (values) => {
18 18
     const data = {
19
-      originEmail: md5(values.email),
20
-      newEmail: md5(values.newEmail),
19
+      originEmail: values.email,
20
+      newEmail: values.newEmail,
21 21
     };
22 22
     await changeEmail(data);
23
-    navigate(`/login`);
24
-
23
+    let email = hideEmail(values?.newEmail);
24
+    setEmail(email)
25
+    setOpEmail(false)
25 26
     return true;
26 27
   };
27 28
 

+ 1
- 1
src/pages/accountsettings/components/ChangeModalPhone.jsx Wyświetl plik

@@ -27,7 +27,7 @@ export default (props) => {
27 27
 
28 28
   return (
29 29
     <ModalForm
30
-      title={t('accountsettings.emailTitle')}
30
+      title={t('accountsettings.phoneTitle')}
31 31
       width="480px"
32 32
       open={opPhone}
33 33
       modalProps={{

+ 36
- 3
src/pages/accountsettings/index.jsx Wyświetl plik

@@ -13,14 +13,31 @@ export default (props) => {
13 13
   const [opPhone, setOpPhone] = useState(false);
14 14
   const [opEmail, setOpEmail] = useState(false);
15 15
   const [phone, setPhone] = useState();
16
+  const [email, setEmail] = useState();
16 17
 
17 18
   const navigate = useNavigate();
18 19
 
19 20
   const { t } = useTranslation();
21
+
22
+  const hideEmail = (email) => {
23
+    // 分割邮箱地址,获取用户名和域名部分  
24
+    const [user, domain] = email?.split('@');
25
+
26
+    // 替换用户名的中间部分为星号  
27
+    const hiddenUser = user.charAt(0) + '****' + user.charAt(user.length - 1);
28
+    console.log('hiddenUser', hiddenUser);
29
+
30
+    // 重新组合隐藏的邮箱地址  
31
+    const hiddenEmail = `${hiddenUser}@${domain}`;
32
+
33
+    return hiddenEmail;
34
+  }
20 35
   useEffect(() => {
21 36
     currentUser().then((res) => {
22 37
       let secretPhone = (res.user.phone).replace(/(\d{3})\d{4}(\d{4})/, '$1****$2');
38
+      let secretEmail = hideEmail(res.user.email);
23 39
       setPhone(secretPhone)
40
+      setEmail(secretEmail)
24 41
     })
25 42
   }, [])
26 43
 
@@ -72,7 +89,7 @@ export default (props) => {
72 89
         </div>
73 90
 
74 91
         <div style={{ display: "flex", alignItems: "stretch", marginTop: '24px' }}>
75
-          <div style={{ flex: 0.5, marginRight: '24px' }}>
92
+          <div style={{ flex: 1, marginRight: '24px' }}>
76 93
             <Card>
77 94
               <div style={{ display: "flex", alignItems: "stretch" }}>
78 95
                 <div style={{ flex: 0.4, display: "flex", justifyContent: "center" }}>
@@ -83,7 +100,23 @@ export default (props) => {
83 100
                     <div style={{ fontSize: "16px", fontWeight: "bold" }}>{t('accountsettings.title3')}</div>
84 101
                     <Button type="ghost" onClick={onOpenEmail}>{t('accountsettings.btnText3')}</Button>
85 102
                   </div>
86
-                  <div style={{ paddingTop: '1em', color: '#bfbfbf' }}>{t('accountsettings.text3')}99****qq.com</div>
103
+                  <div style={{ paddingTop: '1em', color: '#bfbfbf' }}>{t('accountsettings.text3')}{email}</div>
104
+                </div>
105
+              </div>
106
+            </Card>
107
+          </div>
108
+          <div style={{ flex: 1 }}>
109
+            <Card>
110
+              <div style={{ display: "flex", alignItems: "stretch" }}>
111
+                <div style={{ flex: 0.4, display: "flex", justifyContent: "center" }}>
112
+                  <img src="	https://qbitnetwork.com/app/img/ga-qbit.06a15090.png" alt={t('accountsettings.title5')} width="100" />
113
+                </div>
114
+                <div style={{ flex: 1.6 }}>
115
+                  <div style={{ display: "flex", justifyContent: "space-between", paddingTop: '10px' }}>
116
+                    <div style={{ fontSize: "16px", fontWeight: "bold" }}>{t('accountsettings.title5')}</div>
117
+                    <Button type="ghost">{t('accountsettings.btnText5')}</Button>
118
+                  </div>
119
+                  <div style={{ paddingTop: '1em', color: '#bfbfbf' }}>{t('accountsettings.text5')}</div>
87 120
                 </div>
88 121
               </div>
89 122
             </Card>
@@ -113,7 +146,7 @@ export default (props) => {
113 146
 
114 147
         <ChangeModalPhone opPhone={opPhone} setOpPhone={setOpPhone} />
115 148
         <ChangeModalPassword visible={visible} setVisible={setVisible} />
116
-        <ChangeModalEmail opEmail={opEmail} setOpEmail={setOpEmail} />
149
+        <ChangeModalEmail opEmail={opEmail} setOpEmail={setOpEmail} setEmail={setEmail} hideEmail={hideEmail} />
117 150
       </Page>
118 151
     </div>
119 152
   )

+ 49
- 0
src/pages/bindEmail/index.jsx Wyświetl plik

@@ -0,0 +1,49 @@
1
+import React, { useState, useEffect } from "react";
2
+import { Divider, Card, Button, Radio, Form, Input, Row, Col } from "antd";
3
+import { useTranslation } from 'react-i18next';
4
+import { useNavigate } from "react-router-dom";
5
+import { changeEmail } from "@/services/login";
6
+
7
+export default (props) => {
8
+  const navigate = useNavigate();
9
+
10
+  const { t } = useTranslation();
11
+  const [form] = Form.useForm();
12
+
13
+  const onFinish = (values) => {
14
+    changeEmail(values).then((res) => {
15
+      navigate("/authentication");
16
+    })
17
+  };
18
+
19
+  return (
20
+    <Row justify="center" style={{ marginTop: '48px' }}>
21
+      <Col span={12}>
22
+        <Card
23
+          title={
24
+            <div>
25
+              {t('bindEmail.extra')}
26
+            </div>}
27
+        >
28
+          <Form
29
+            form={form}
30
+            size="large"
31
+            onFinish={onFinish}
32
+          >
33
+            <Form.Item label={t('bindEmail.label')} rules={[{ required: true, message: t('bindEmail.message') }]} name="newEmail">
34
+              <Input placeholder={t('bindEmail.placeholder')} />
35
+
36
+            </Form.Item>
37
+            <Form.Item>
38
+              <div style={{ display: 'flex', justifyContent: 'flex-end' }}>
39
+                <Button type="primary" htmlType="submit">
40
+                  {t('bindEmail.submit')}
41
+                </Button>
42
+              </div>
43
+            </Form.Item>
44
+          </Form>
45
+        </Card>
46
+      </Col>
47
+    </Row>
48
+  )
49
+}

+ 3
- 3
src/pages/incorporation/index.jsx Wyświetl plik

@@ -36,21 +36,21 @@ export default (props) => {
36 36
         <Card>
37 37
           <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', padding: '0 24px' }}>
38 38
             <div style={{ textAlign: 'center' }}>
39
-              <img src="https://qbitnetwork.com/app/img/register-img-1.f346588c.png" width="130px" />
39
+              <img src="./img/step4.jpg" width="130px" />
40 40
               <div style={{ fontSize: '14px', fontWeight: 'bold' }}>
41 41
                 {t('incorporation.title4')}
42 42
               </div>
43 43
             </div>
44 44
             <div style={{ border: '1px dashed #82ced2', width: '20vw' }} />
45 45
             <div style={{ textAlign: 'center' }}>
46
-              <img src="https://qbitnetwork.com/app/img/register-img-2.cc735250.png" width="130px" />
46
+              <img src="./img/step5.jpg" width="130px" />
47 47
               <div style={{ fontSize: '14px', fontWeight: 'bold' }}>
48 48
                 {t('incorporation.title5')}
49 49
               </div>
50 50
             </div>
51 51
             <div style={{ border: '1px dashed #82ced2', width: '20vw' }} />
52 52
             <div style={{ textAlign: 'center' }}>
53
-              <img src="https://qbitnetwork.com/app/img/register-img-3.b5b8bd86.png" width="130px" />
53
+              <img src="./img/step6.jpg" width="130px" />
54 54
               <div style={{ fontSize: '14px', fontWeight: 'bold' }}>
55 55
                 {t('incorporation.title6')}
56 56
               </div>

+ 35
- 33
src/pages/qRegister/QRegister.jsx Wyświetl plik

@@ -17,28 +17,29 @@ export default (props) => {
17 17
   const formRef = useRef();
18 18
 
19 19
   const onFinish = (values) => {
20
-    // setLoading(true);
21
-    // register({
22
-    //   userName: values.userName,
23
-    //   loginType: "admin.pc",
24
-    //   password: values.password,
25
-    //   phone: values.phone
26
-    // })
27
-    //   .then((res) => {
28
-    //     setLoading(true);
29
-    //     try {
30
-    //       navigate("/qLogin");
31
-    //     } catch (e) {
32
-    //       message.error(e);
33
-    //     }
34
-    //     setLoading(false);
35
-    //   })
36
-    //   .catch((err) => {
37
-    //     setLoading(false);
38
-    //   });
20
+    setLoading(true);
21
+    register({
22
+      userName: values.userName,
23
+      loginType: "admin.pc",
24
+      password: values.password,
25
+      phone: values.phone,
26
+      wxNum: values.wxNum,
27
+      invitationCode: values.invitationCode
28
+    })
29
+      .then((res) => {
30
+        setLoading(true);
31
+        try {
32
+          navigate("/qLogin");
33
+        } catch (e) {
34
+          message.error(e);
35
+        }
36
+        setLoading(false);
37
+      })
38
+      .catch((err) => {
39
+        setLoading(false);
40
+      });
39 41
 
40
-    // setLoading(false);
41
-    navigate("/qLogin");
42
+    setLoading(false);
42 43
   }
43 44
 
44 45
   return (
@@ -114,29 +115,30 @@ export default (props) => {
114 115
         </Form.Item> */}
115 116
         <Form.Item
116 117
           label="微信号(选填)"
117
-          name="wxId"
118
+          name="wxNum"
118 119
         >
119 120
           <Input placeholder="请输入微信号/手机号" style={{ borderRadius: "4px" }} />
120 121
         </Form.Item>
121 122
         <Form.Item
122 123
           label="邀请码(选填)"
123
-          name="ycCode"
124
+          name="invitationCode"
124 125
         >
125 126
           <Input placeholder="若有,请输入邀请码" style={{ borderRadius: "4px" }} />
126 127
         </Form.Item>
127
-        {/* 这个是 我已阅读并同意 的东西,涛哥你看适当放开 */}
128 128
 
129
-        {/* <Form.Item name="check"
129
+        <Form.Item name="check"
130 130
           rules={[{ required: true, message: '请阅读并勾选协议' }]}>
131
-          <Checkbox>
132
-            <div>
133
-              <span>我已阅读并同意</span>
134
-              <a href="https://qbitnetwork.com/terms?type=QbitGeneralTermsAndConditions" target="_blank">快云 General Terms and Conditions</a>和
135
-              <a href="https://qbitnetwork.com/terms?type=PrivacyPolicies" target="_blank">Privacy Policies</a>
136
-            </div>
131
+          <Checkbox.Group value="1">
132
+            <Checkbox value="1">
133
+              <div>
134
+                <span>我已阅读并同意</span>
135
+                <a href="https://qbitnetwork.com/terms?type=QbitGeneralTermsAndConditions" target="_blank">快云 General Terms and Conditions</a>和
136
+                <a href="https://qbitnetwork.com/terms?type=PrivacyPolicies" target="_blank">Privacy Policies</a>
137
+              </div>
137 138
 
138
-          </Checkbox>
139
-        </Form.Item> */}
139
+            </Checkbox>
140
+          </Checkbox.Group>
141
+        </Form.Item>
140 142
         <Form.Item>
141 143
           <Button
142 144
             type="primary"

+ 9
- 0
src/routes/routes.jsx Wyświetl plik

@@ -27,6 +27,7 @@ import StoreForeignExchange from "@/pages/storeforeignexchange";
27 27
 import QuantuMstored from "@/pages/quantumstored";
28 28
 import QuantumCredit from "@/pages/quantumcredit";
29 29
 import TransactionInquiry from "@/pages/transactioninquiry";
30
+import BindEmail from "@/pages/bindEmail";
30 31
 import FirstPage from "@/pages/firstPage/index";
31 32
 
32 33
 import QLogin from "@/pages/qLogin/index";
@@ -180,6 +181,14 @@ export const authRoutes = [
180 181
       icon: <SettingOutlined />,
181 182
     },
182 183
   },
184
+  {
185
+    path: "bindEmail",
186
+    element: <BindEmail />,
187
+    meta: {
188
+      title: "绑定邮箱",
189
+      hideInMenu: true,
190
+    },
191
+  },
183 192
 ];
184 193
 
185 194
 export const defaultRoutes = [