mirror of
https://github.com/didi/KnowStreaming.git
synced 2026-01-05 21:12:13 +08:00
前端优化
This commit is contained in:
@@ -46,7 +46,7 @@
|
||||
box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.04), 0 6px 12px 12px rgba(0, 0, 0, 0.04), 0 6px 10px 0 rgba(0, 0, 0, 0.08);
|
||||
border-radius: 8px;
|
||||
&-content {
|
||||
padding: 10px 8px 4px 8px;
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
.dcloud-popover-arrow-content {
|
||||
@@ -56,6 +56,7 @@
|
||||
display: flex;
|
||||
flex-flow: row wrap;
|
||||
max-width: 560px;
|
||||
padding: 10px 8px 4px 8px;
|
||||
.container-item {
|
||||
flex-shrink: 0;
|
||||
height: 20px;
|
||||
|
||||
@@ -31,10 +31,10 @@ export interface PermissionNode {
|
||||
}
|
||||
|
||||
const CommonConfig = (): JSX.Element => {
|
||||
const [global, setGlobal] = AppContainer.useGlobalValue();
|
||||
const [, setGlobal] = AppContainer.useGlobalValue();
|
||||
|
||||
// 获取权限树
|
||||
const getPermissionTree = (userId: number) => {
|
||||
const getPermissionTree = (userInfo, userId: number) => {
|
||||
const getUserInfo = Utils.request(`/logi-security/api/v1/user/${userId}`);
|
||||
const getPermissionTree = Utils.request('/logi-security/api/v1/permission/tree');
|
||||
|
||||
@@ -55,18 +55,16 @@ const CommonConfig = (): JSX.Element => {
|
||||
|
||||
useLayoutEffect(() => {
|
||||
// 如果未登录,直接跳转到登录页
|
||||
const userInfo = localStorage.getItem('userInfo');
|
||||
let userId: number;
|
||||
const userInfoStorage = localStorage.getItem('userInfo');
|
||||
|
||||
try {
|
||||
userId = JSON.parse(userInfo).id;
|
||||
const userInfo = JSON.parse(userInfoStorage);
|
||||
const userId = userInfo.id;
|
||||
if (!userId) throw 'err';
|
||||
getPermissionTree(userInfo, userId);
|
||||
} catch (_) {
|
||||
goLogin();
|
||||
return;
|
||||
}
|
||||
|
||||
getPermissionTree(userId);
|
||||
}, []);
|
||||
|
||||
return <></>;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { Button, Form, Input, Select, ProTable, DatePicker, Utils } from 'knowdesign';
|
||||
import { Button, Form, Input, Select, ProTable, DatePicker, Utils, Tooltip } from 'knowdesign';
|
||||
import api from 'api';
|
||||
import { defaultPagination } from 'constants/common';
|
||||
import TypicalListCard from '../../components/TypicalListCard';
|
||||
@@ -39,6 +39,13 @@ export default () => {
|
||||
dataIndex: 'detail',
|
||||
width: 350,
|
||||
lineClampOne: true,
|
||||
render(content) {
|
||||
return (
|
||||
<Tooltip placement="bottomLeft" title={content}>
|
||||
{content}
|
||||
</Tooltip>
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '操作时间',
|
||||
|
||||
Reference in New Issue
Block a user