From 2d06115a4eef9217f9b1e0376ff28339648a14e6 Mon Sep 17 00:00:00 2001 From: zzy <> Date: Wed, 3 Aug 2022 15:03:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AF=86=E9=92=A5=E7=AE=A1?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/proxy.ts | 2 +- src/pages/System/SecretKey/index.less | 24 +++++++++++++++++++ src/pages/System/SecretKey/index.tsx | 34 +++++++++++++++++++++++++++ src/routes/index.ts | 5 ++++ src/routes/routePath.ts | 1 + src/services/System/secretKey.ts | 26 ++++++++++++++++++++ 6 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 src/pages/System/SecretKey/index.less create mode 100644 src/pages/System/SecretKey/index.tsx create mode 100644 src/services/System/secretKey.ts 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 ( +