[improvement](semantic-fe) Added parameter compatibility for network requests in different modes

This commit is contained in:
tristanliu
2023-06-21 11:10:07 +08:00
parent 693fc03c6f
commit 9c9d7382fe
12 changed files with 42 additions and 42 deletions

View File

@@ -26,6 +26,7 @@ type Props = {
const DEFAULT_LEFT_SIZE = '300px';
const DomainManger: React.FC<Props> = ({ domainManger, dispatch }) => {
window.RUNNING_ENV = 'semantic';
const [collapsed, setCollapsed] = useState(false);
const [leftSize, setLeftSize] = useState('');
const { selectDomainId, selectDomainName } = domainManger;

View File

@@ -196,7 +196,6 @@ const DomainManger: React.FC<Props> = ({ domainManger, domainId }) => {
};
// const [visible, setVisible] = useState(false);
useEffect(() => {
console.log(domainId, graphData, 'domainId');
if (!(Array.isArray(graphData.children) && graphData.children.length > 0)) {
return;
}
@@ -356,7 +355,6 @@ const DomainManger: React.FC<Props> = ({ domainManger, domainId }) => {
labelCfg: { style: { fill: '#3c3c3c' } },
};
});
console.log(graphData, 'graphData');
// graph.data(graphData);
graph.changeData(graphData);
graph.render();
@@ -386,7 +384,6 @@ const DomainManger: React.FC<Props> = ({ domainManger, domainId }) => {
value={graphShowType}
onChange={(e) => {
const { value } = e.target;
console.log(value, 'value');
setGraphShowType(value);
changeGraphData(dataSourceListData, value);
}}

View File

@@ -53,14 +53,14 @@ const PermissionTable: React.FC<Props> = ({ domainManger }) => {
const queryDepartmentData = async () => {
const { code, data } = await getDepartmentTree();
if (code === 200) {
if (code === 200 || code === '0') {
setDepartmentTreeData(data);
}
};
const queryTmePersonData = async () => {
const { code, data } = await getAllUser();
if (code === 200) {
if (code === 200 || Number(code) === 0) {
setTmePerson(data);
}
};