Skip to content

Commit

Permalink
[ISSUE #10318]fix import bug (#10319)
Browse files Browse the repository at this point in the history
* fix import bug

* fix import bug
  • Loading branch information
985492783 authored and KomachiSion committed May 25, 2023
1 parent 6080b01 commit bf37a8a
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 13 deletions.
1 change: 1 addition & 0 deletions console-ui/src/globalLib.js
Expand Up @@ -563,5 +563,6 @@ export {
getParams,
setParam,
setParams,
goLogin,
request,
};
Expand Up @@ -43,13 +43,14 @@ import ShowCodeing from 'components/ShowCodeing';
import DeleteDialog from 'components/DeleteDialog';
import DashboardCard from './DashboardCard';
import { getParams, setParams, request } from '@/globalLib';
import { goLogin } from '../../../globalLib';
import { connect } from 'react-redux';
import { getConfigs, getConfigsV2 } from '../../../reducers/configuration';
import PageTitle from '../../../components/PageTitle';
import QueryResult from '../../../components/QueryResult';

import './index.scss';
import { LANGUAGE_KEY, GLOBAL_PAGE_SIZE_LIST } from '../../../constants';
import { LANGUAGE_KEY, GLOBAL_PAGE_SIZE_LIST, LOGINPAGE_ENABLED } from '../../../constants';

const { Item } = MenuButton;
const { Panel } = Collapse;
Expand Down Expand Up @@ -1013,12 +1014,22 @@ class ConfigurationManagement extends React.Component {
const { locale = {} } = this.props;
const self = this;
self.field.setValue('sameConfigPolicy', 'ABORT');

const _LOGINPAGE_ENABLED = localStorage.getItem(LOGINPAGE_ENABLED);
let token = {};
try {
token = JSON.parse(localStorage.token);
} catch (e) {
console.log(e);
goLogin();

if (_LOGINPAGE_ENABLED !== 'false') {
try {
token = JSON.parse(localStorage.token);
} catch (e) {
console.log(e);
goLogin();
Dialog.alert({
title: locale.importFail,
content: locale.authFail,
});
return;
}
}
const { accessToken = '', username = '' } = token;
const uploadProps = {
Expand Down
4 changes: 2 additions & 2 deletions console/src/main/resources/static/index.html
Expand Up @@ -35,7 +35,7 @@
<link rel="stylesheet" type="text/css" href="console-ui/public/css/icon.css">
<link rel="stylesheet" type="text/css" href="console-ui/public/css/font-awesome.css">
<!-- 第三方css结束 -->
<link href="./css/main.css?6279658183dab105bcb6" rel="stylesheet"></head>
<link href="./css/main.css?711c34427bb0227d8941" rel="stylesheet"></head>

<body>
<div id="root" style="overflow:hidden"></div>
Expand All @@ -56,6 +56,6 @@
<script src="console-ui/public/js/merge.js"></script>
<script src="console-ui/public/js/loader.js"></script>
<!-- 第三方js结束 -->
<script type="text/javascript" src="./js/main.js?6279658183dab105bcb6"></script></body>
<script type="text/javascript" src="./js/main.js?711c34427bb0227d8941"></script></body>

</html>

0 comments on commit bf37a8a

Please sign in to comment.