Procházet zdrojové kódy

跳转开放平台

huiqi před 3 měsíci
rodič
revize
4fbe1c2dc0
1 změnil soubory, kde provedl 29 přidání a 1 odebrání
  1. 29 1
      app/components/DeekSeekHome.tsx

+ 29 - 1
app/components/DeekSeekHome.tsx

@@ -117,6 +117,34 @@ const DeekSeek: React.FC = () => {
                     {/*}}>*/}
                     {/*    DeepSeek问答*/}
                     {/*</div>*/}
+
+                    {/* 右侧跳转按钮 */}
+                    <div style={{
+                        marginLeft: 'auto', // 自动占据左侧空间,将按钮推到最右侧
+                        marginRight: 20 // 右侧间距,与其他元素保持一致
+                    }}>
+                        <button
+                            onClick={() => {
+                                // 跳转到其他平台的逻辑,这里使用window.open举例
+                                const userInfo = localStorage.getItem('userInfo');
+                                const tokenParam = userInfo ? "?token=" + JSON.parse(userInfo).token : "";
+                                window.open('http://localhost:3100' + tokenParam, '_blank');
+                                // 如果是内部路由跳转,可以使用navigate:
+                                // navigate('/target-path');
+                            }}
+                            style={{
+                                padding: '6px 12px',
+                                backgroundColor: '#165DFF', // 蓝色按钮,可根据设计调整
+                                color: 'white',
+                                border: 'none',
+                                borderRadius: 4,
+                                cursor: 'pointer',
+                                whiteSpace: 'nowrap'
+                            }}
+                        >
+                            前往开放平台
+                        </button>
+                    </div>
                 </div>
                 <div className='deekSeek-content'>
                     <div className='deekSeek-content-title'>
@@ -134,4 +162,4 @@ const DeekSeek: React.FC = () => {
     );
 };
 
-export default DeekSeek;
+export default DeekSeek;