mirror of
https://github.com/didi/KnowStreaming.git
synced 2026-01-04 11:52:07 +08:00
同步代码
This commit is contained in:
@@ -7,7 +7,6 @@ export const licenseEventBus = new EventBus();
|
||||
|
||||
export const goLogin = () => {
|
||||
if (!window.location.pathname.includes('login')) {
|
||||
// notification.error({ message: '当前未登录,将自动跳转到登录页' });
|
||||
window.history.replaceState({}, '', `/login?redirect=${window.location.href.slice(window.location.origin.length)}`);
|
||||
}
|
||||
};
|
||||
@@ -22,7 +21,7 @@ serviceInstance.interceptors.request.use(
|
||||
(config: any) => {
|
||||
const user = Utils.getCookie('X-SSO-USER');
|
||||
const id = Utils.getCookie('X-SSO-USER-ID');
|
||||
if ((!user || !id) && !window.location.pathname.toLowerCase().startsWith('/login')) {
|
||||
if (!user || !id) {
|
||||
goLogin();
|
||||
} else {
|
||||
config.headers['X-SSO-USER'] = user; // 请求携带token
|
||||
|
||||
@@ -1,5 +1,32 @@
|
||||
import moment from 'moment';
|
||||
|
||||
export const CHART_COLOR_LIST = [
|
||||
'#657DFC',
|
||||
'#A7B1EB',
|
||||
'#85C80D',
|
||||
'#C9E795',
|
||||
'#FFC300',
|
||||
'#F9D77B',
|
||||
'#8BA3C4',
|
||||
'#C2D0E3',
|
||||
'#FF7066',
|
||||
'#F5B6B3',
|
||||
'#2AC8E4',
|
||||
'#9DDEEB',
|
||||
'#A76CEC',
|
||||
'#CCABF1',
|
||||
'#FF9C1B',
|
||||
'#F5C993',
|
||||
'#3991FF',
|
||||
'#94BEF2',
|
||||
'#12CA7A',
|
||||
'#A7E6C7',
|
||||
'#FF5AB2',
|
||||
'#F19FC9',
|
||||
'#AEAEAE',
|
||||
'#D1D1D1',
|
||||
];
|
||||
|
||||
export const UNIT_MAP = {
|
||||
TB: Math.pow(1024, 4),
|
||||
GB: Math.pow(1024, 3),
|
||||
@@ -160,11 +187,8 @@ export const getBasicChartConfig = (props: any = {}) => {
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
axisLabel: {
|
||||
interval: 0,
|
||||
hideOverlap: false,
|
||||
color: '#495057',
|
||||
fontSize: 12,
|
||||
lineHeight: 20,
|
||||
},
|
||||
splitLine: {
|
||||
show: true,
|
||||
@@ -183,11 +207,11 @@ export const getBasicChartConfig = (props: any = {}) => {
|
||||
const result =
|
||||
tooltipWidth + pos[0] < size.viewSize[0]
|
||||
? {
|
||||
top: 40,
|
||||
top: 10,
|
||||
left: pos[0] + 30,
|
||||
}
|
||||
: {
|
||||
top: 40,
|
||||
top: 10,
|
||||
left: pos[0] - tooltipWidth - 30,
|
||||
};
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user