WIP: user-zzy-dev #1

Closed
Ghost wants to merge 12 commits from user-zzy-dev into master
6 changed files with 91 additions and 1 deletions
Showing only changes of commit 2d06115a4e - Show all commits

View File

@ -11,7 +11,7 @@ export default {
// localhost:8000/api/** -> https://preview.pro.ant.design/api/** // localhost:8000/api/** -> https://preview.pro.ant.design/api/**
'/tbg/api/v1': { '/tbg/api/v1': {
// 要代理的地址 // 要代理的地址
target: 'http://192.168.1.226:9999', target: 'http://0.0.0.0:9999',
// 配置了这个可以从 http 代理到 https // 配置了这个可以从 http 代理到 https
// 依赖 origin 的功能可能需要这个,比如 cookie // 依赖 origin 的功能可能需要这个,比如 cookie
changeOrigin: true, changeOrigin: true,

View File

@ -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;
}

View File

@ -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 (
<div className={styles.container}>
<Button className={styles.button} type="primary" onClick={create}>
</Button>
<TextArea className={styles.textarea} rows={16} value={secretKey} />
</div>
);
};
export default SecretKey;

View File

@ -65,6 +65,11 @@ export default [
path: RoutePath.PERMISSIONS.LIST, path: RoutePath.PERMISSIONS.LIST,
component: './System/Permissions/List', component: './System/Permissions/List',
}, },
{
name: '密钥管理',
path: RoutePath.SECRET_KEY,
component: './System/SecretKey',
},
], ],
}, },
{ {

View File

@ -26,6 +26,7 @@ const RoutePath = {
PERMISSIONS: { PERMISSIONS: {
LIST: `${SYSTEM}/permissions`, LIST: `${SYSTEM}/permissions`,
}, },
SECRET_KEY: `${SYSTEM}/secret_key`,
SETTING: SETTING, SETTING: SETTING,
WORK: { WORK: {
LIST: `${SETTING}/work`, LIST: `${SETTING}/work`,

View File

@ -0,0 +1,26 @@
import request from '@/utils/request';
/**
*
* @param {object} params
* @returns {array} data
*/
export const getSecretKey = () => {
return request.request({
url: '/key/get',
method: 'get',
});
};
/**
*
* @param {object} data
* @returns {array} data
*/
export const createSecretKey = (data) => {
return request.request({
url: '/key/create',
method: 'post',
data,
});
};