diff --git a/config/proxy.ts b/config/proxy.ts index 3bc1829..afc029a 100644 --- a/config/proxy.ts +++ b/config/proxy.ts @@ -11,7 +11,7 @@ export default { // localhost:8000/api/** -> https://preview.pro.ant.design/api/** '/tbg/api/v1': { // 要代理的地址 - target: 'http://192.168.1.226:9999', + target: 'http://0.0.0.0:9999', // 配置了这个可以从 http 代理到 https // 依赖 origin 的功能可能需要这个,比如 cookie changeOrigin: true, diff --git a/src/pages/System/SecretKey/index.less b/src/pages/System/SecretKey/index.less new file mode 100644 index 0000000..1565eba --- /dev/null +++ b/src/pages/System/SecretKey/index.less @@ -0,0 +1,24 @@ +@import '~antd/es/style/themes/default.less'; + +.container { + display: flex; + flex-direction: column; + height: 100vh; + padding: 20px; + overflow: auto; + background: white; + :global { + .ant-pro-form-login-header { + margin-bottom: 40px; + } + } +} + +.button { + width: 150px; +} + +.textarea { + width: 600px; + margin-top: 20px; +} diff --git a/src/pages/System/SecretKey/index.tsx b/src/pages/System/SecretKey/index.tsx new file mode 100644 index 0000000..51e6449 --- /dev/null +++ b/src/pages/System/SecretKey/index.tsx @@ -0,0 +1,34 @@ +import React, { useState, useEffect } from 'react'; +import { Button, Input } from 'antd'; +import styles from './index.less'; +import { createSecretKey, getSecretKey } from '@/services/System/secretKey'; + +const { TextArea } = Input; + +const SecretKey: React.FC = () => { + const [secretKey, setSecretKey] = useState(''); + + const create = async () => { + await createSecretKey({}); + }; + + const getUserSecretKey = async () => { + const data = await getSecretKey(); + setSecretKey(data + ''); + }; + + useEffect(() => { + getUserSecretKey(); + }, []); + + return ( +