Sfoglia il codice sorgente

fix: show bind options only available (close #65)

JustSong 2 anni fa
parent
commit
b92ec5e54c
1 ha cambiato i file con 16 aggiunte e 8 eliminazioni
  1. 16 8
      web/src/components/PersonalSetting.js

+ 16 - 8
web/src/components/PersonalSetting.js

@@ -112,13 +112,17 @@ const PersonalSetting = () => {
       <Button onClick={generateAccessToken}>生成系统访问令牌</Button>
       <Divider />
       <Header as='h3'>账号绑定</Header>
-      <Button
-        onClick={() => {
-          setShowWeChatBindModal(true);
-        }}
-      >
-        绑定微信账号
-      </Button>
+      {
+        status.wechat_login && (
+          <Button
+            onClick={() => {
+              setShowWeChatBindModal(true);
+            }}
+          >
+            绑定微信账号
+          </Button>
+        )
+      }
       <Modal
         onClose={() => setShowWeChatBindModal(false)}
         onOpen={() => setShowWeChatBindModal(true)}
@@ -148,7 +152,11 @@ const PersonalSetting = () => {
           </Modal.Description>
         </Modal.Content>
       </Modal>
-      <Button onClick={openGitHubOAuth}>绑定 GitHub 账号</Button>
+      {
+        status.github_oauth && (
+          <Button onClick={openGitHubOAuth}>绑定 GitHub 账号</Button>
+        )
+      }
       <Button
         onClick={() => {
           setShowEmailBindModal(true);