Complete main UI #37
@@ -29,7 +29,7 @@ const AuthRoute = () => {
|
|||||||
return <Navigate to={'/verify'} />
|
return <Navigate to={'/verify'} />
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isLogin && lastMatch.pathname === '/login') {
|
if (isLogin && ['/login', '/forget'].includes(lastMatch.pathname)) {
|
||||||
return <Navigate to={'/'} />
|
return <Navigate to={'/'} />
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import React, { useState } from 'react'
|
|||||||
import Icon from '@ant-design/icons'
|
import Icon from '@ant-design/icons'
|
||||||
import { COLOR_ERROR } from '@/constants/common.constants'
|
import { COLOR_ERROR } from '@/constants/common.constants'
|
||||||
import { getRedirectUrl } from '@/util/route'
|
import { getRedirectUrl } from '@/util/route'
|
||||||
|
import { useUpdatedEffect } from '@/util/hooks'
|
||||||
import { getAvatar, getLoginStatus, getNickname, removeToken } from '@/util/auth'
|
import { getAvatar, getLoginStatus, getNickname, removeToken } from '@/util/auth'
|
||||||
import { r_auth_logout } from '@/services/auth'
|
import { r_auth_logout } from '@/services/auth'
|
||||||
|
|
||||||
@@ -42,7 +43,7 @@ const SidebarFooter: React.FC = () => {
|
|||||||
|
|
||||||
const loginStatus = getLoginStatus()
|
const loginStatus = getLoginStatus()
|
||||||
|
|
||||||
useEffect(() => {
|
useUpdatedEffect(() => {
|
||||||
if (getLoginStatus()) {
|
if (getLoginStatus()) {
|
||||||
void getNickname().then((nickname) => {
|
void getNickname().then((nickname) => {
|
||||||
setNickname(nickname)
|
setNickname(nickname)
|
||||||
|
|||||||
@@ -281,7 +281,12 @@ const OnlineInfo: React.FC = () => {
|
|||||||
loading={isLoading}
|
loading={isLoading}
|
||||||
expand={
|
expand={
|
||||||
<>
|
<>
|
||||||
<AntdSelect value={scope} onChange={handleOnScopeChange} disabled={isLoading}>
|
<AntdSelect
|
||||||
|
value={scope}
|
||||||
|
onChange={handleOnScopeChange}
|
||||||
|
disabled={isLoading}
|
||||||
|
style={{ width: '8em' }}
|
||||||
|
>
|
||||||
<AntdSelect.Option key={'DAY'}>今天</AntdSelect.Option>
|
<AntdSelect.Option key={'DAY'}>今天</AntdSelect.Option>
|
||||||
<AntdSelect.Option key={'WEAK'}>最近7天</AntdSelect.Option>
|
<AntdSelect.Option key={'WEAK'}>最近7天</AntdSelect.Option>
|
||||||
<AntdSelect.Option key={'MONTH'}>最近30天</AntdSelect.Option>
|
<AntdSelect.Option key={'MONTH'}>最近30天</AntdSelect.Option>
|
||||||
@@ -399,6 +404,7 @@ const ActiveInfo: React.FC = () => {
|
|||||||
|
|
||||||
activeInfoEChartsRef.current?.setOption({
|
activeInfoEChartsRef.current?.setOption({
|
||||||
...lineEChartsBaseOption,
|
...lineEChartsBaseOption,
|
||||||
|
useUTC: true,
|
||||||
tooltip: {
|
tooltip: {
|
||||||
...lineEChartsBaseOption.tooltip,
|
...lineEChartsBaseOption.tooltip,
|
||||||
formatter: getTooltipTimeFormatter('yyyy-MM-DD')
|
formatter: getTooltipTimeFormatter('yyyy-MM-DD')
|
||||||
@@ -457,7 +463,12 @@ const ActiveInfo: React.FC = () => {
|
|||||||
loading={isLoading}
|
loading={isLoading}
|
||||||
expand={
|
expand={
|
||||||
<>
|
<>
|
||||||
<AntdSelect value={scope} onChange={handleOnScopeChange} disabled={isLoading}>
|
<AntdSelect
|
||||||
|
value={scope}
|
||||||
|
onChange={handleOnScopeChange}
|
||||||
|
disabled={isLoading}
|
||||||
|
style={{ width: '8em' }}
|
||||||
|
>
|
||||||
<AntdSelect.Option key={'WEAK'}>最近7天</AntdSelect.Option>
|
<AntdSelect.Option key={'WEAK'}>最近7天</AntdSelect.Option>
|
||||||
<AntdSelect.Option key={'MONTH'}>最近30天</AntdSelect.Option>
|
<AntdSelect.Option key={'MONTH'}>最近30天</AntdSelect.Option>
|
||||||
<AntdSelect.Option key={'QUARTER'}>最近3个月</AntdSelect.Option>
|
<AntdSelect.Option key={'QUARTER'}>最近3个月</AntdSelect.Option>
|
||||||
|
|||||||
Reference in New Issue
Block a user