Fix can not autoload in production mode bug

This commit is contained in:
2024-01-15 15:57:48 +08:00
parent bcf29f74ef
commit 6d08e1a8e8
24 changed files with 36 additions and 57 deletions

View File

@@ -10,7 +10,6 @@ import {
DATABASE_SELECT_SUCCESS,
DATABASE_UPDATE_SUCCESS
} from '@/constants/common.constants'
import { useUpdatedEffect } from '@/util/hooks'
import { hasPermission } from '@/util/auth'
import { utcToLocalTime } from '@/util/datetime'
import {
@@ -484,7 +483,7 @@ const Group = () => {
}
}, [formValues])
useUpdatedEffect(() => {
useEffect(() => {
getGroup()
}, [
JSON.stringify(tableParams.filters),

View File

@@ -1,7 +1,6 @@
import { ChangeEvent, KeyboardEvent } from 'react'
import dayjs from 'dayjs'
import { COLOR_FONT_SECONDARY, DATABASE_SELECT_SUCCESS } from '@/constants/common.constants'
import { useUpdatedEffect } from '@/util/hooks'
import { dayjsToUtc, utcToLocalTime } from '@/util/datetime'
import { r_sys_log_get } from '@/services/system'
import FitFullscreen from '@/components/common/FitFullscreen'
@@ -223,7 +222,7 @@ const Log = () => {
})
}
useUpdatedEffect(() => {
useEffect(() => {
getLog()
}, [
JSON.stringify(tableParams.filters),

View File

@@ -10,7 +10,6 @@ import {
DATABASE_SELECT_SUCCESS,
DATABASE_UPDATE_SUCCESS
} from '@/constants/common.constants'
import { useUpdatedEffect } from '@/util/hooks'
import { utcToLocalTime } from '@/util/datetime'
import { hasPermission, powerListToPowerTree } from '@/util/auth'
import {
@@ -493,7 +492,7 @@ const Role = () => {
}
}, [formValues])
useUpdatedEffect(() => {
useEffect(() => {
getRole()
}, [
JSON.stringify(tableParams.filters),

View File

@@ -1,4 +1,3 @@
import { useUpdatedEffect } from '@/util/hooks'
import { hasPermission } from '@/util/auth'
import { r_sys_settings_base_get, r_sys_settings_base_update } from '@/services/system'
import { SettingsCard } from '@/pages/System/Settings'
@@ -40,7 +39,7 @@ const Base = () => {
})
}
useUpdatedEffect(() => {
useEffect(() => {
getBaseSettings()
}, [])

View File

@@ -1,5 +1,4 @@
import Icon from '@ant-design/icons'
import { useUpdatedEffect } from '@/util/hooks'
import { hasPermission } from '@/util/auth'
import {
r_sys_settings_mail_get,
@@ -95,7 +94,7 @@ const Mail = () => {
})
}
useUpdatedEffect(() => {
useEffect(() => {
getMailSettings()
}, [])

View File

@@ -1,7 +1,6 @@
import { ChangeEvent } from 'react'
import Icon from '@ant-design/icons'
import { DATABASE_DUPLICATE_KEY, DATABASE_INSERT_SUCCESS } from '@/constants/common.constants'
import { useUpdatedEffect } from '@/util/hooks'
import {
r_sys_settings_sensitive_add,
r_sys_settings_sensitive_delete,
@@ -95,7 +94,7 @@ const SensitiveWord = () => {
})
}
useUpdatedEffect(() => {
useEffect(() => {
getSensitiveWordSettings()
}, [])

View File

@@ -1,6 +1,5 @@
import Icon from '@ant-design/icons'
import * as echarts from 'echarts/core'
import { useUpdatedEffect } from '@/util/hooks'
import { getTimesBetweenTwoTimes } from '@/util/datetime'
import { r_sys_statistics_active } from '@/services/system'
import FlexBox from '@/components/common/FlexBox'
@@ -13,7 +12,7 @@ const ActiveInfo = () => {
const [isLoading, setIsLoading] = useState(false)
const [scope, setScope] = useState('WEAK')
useUpdatedEffect(() => {
useEffect(() => {
const chartResizeObserver = new ResizeObserver(() => {
activeInfoEChartsRef.current?.resize()
})
@@ -25,7 +24,7 @@ const ActiveInfo = () => {
}
}, [isLoading])
useUpdatedEffect(() => {
useEffect(() => {
getActiveInfo()
}, [])

View File

@@ -1,6 +1,5 @@
import * as echarts from 'echarts/core'
import { BarSeriesOption } from 'echarts/charts'
import { useUpdatedEffect } from '@/util/hooks'
import { r_sys_statistics_cpu } from '@/services/system'
import FlexBox from '@/components/common/FlexBox'
import {
@@ -26,7 +25,7 @@ const CPUInfo = () => {
}
}
useUpdatedEffect(() => {
useEffect(() => {
const chartResizeObserver = new ResizeObserver(() => {
cpuInfoEChartsRef.current.forEach((value) => value.resize())
})
@@ -38,7 +37,7 @@ const CPUInfo = () => {
}
}, [cpuInfoDivRef.current])
useUpdatedEffect(() => {
useEffect(() => {
const intervalId = setInterval(getCpuInfo(), parseInt(refreshInterval) * 1000)
return () => {

View File

@@ -1,4 +1,3 @@
import { useUpdatedEffect } from '@/util/hooks'
import { r_sys_statistics_hardware } from '@/services/system'
import FlexBox from '@/components/common/FlexBox'
import { CommonCard } from '@/pages/System/Statistics'
@@ -6,7 +5,7 @@ import { CommonCard } from '@/pages/System/Statistics'
const HardwareInfo = () => {
const [hardwareInfoData, setHardwareInfoData] = useState<HardwareInfoVo>()
useUpdatedEffect(() => {
useEffect(() => {
void r_sys_statistics_hardware().then((res) => {
const response = res.data
if (response.success) {

View File

@@ -1,6 +1,5 @@
import Icon from '@ant-design/icons'
import * as echarts from 'echarts/core'
import { useUpdatedEffect } from '@/util/hooks'
import { getTimesBetweenTwoTimes } from '@/util/datetime'
import { r_sys_statistics_online } from '@/services/system'
import FlexBox from '@/components/common/FlexBox'
@@ -14,7 +13,7 @@ const OnlineInfo = () => {
const [currentOnlineCount, setCurrentOnlineCount] = useState(-1)
const [scope, setScope] = useState('WEAK')
useUpdatedEffect(() => {
useEffect(() => {
const chartResizeObserver = new ResizeObserver(() => {
onlineInfoEChartsRef.current?.resize()
})
@@ -26,7 +25,7 @@ const OnlineInfo = () => {
}
}, [isLoading])
useUpdatedEffect(() => {
useEffect(() => {
getOnlineInfo()
}, [])

View File

@@ -1,4 +1,3 @@
import { useUpdatedEffect } from '@/util/hooks'
import { utcToLocalTime } from '@/util/datetime'
import { r_sys_statistics_software } from '@/services/system'
import FlexBox from '@/components/common/FlexBox'
@@ -7,7 +6,7 @@ import { CommonCard } from '@/pages/System/Statistics'
const SoftwareInfo = () => {
const [softwareInfoData, setSoftwareInfoData] = useState<SoftwareInfoVo>()
useUpdatedEffect(() => {
useEffect(() => {
void r_sys_statistics_software().then((res) => {
const response = res.data
if (response.success) {

View File

@@ -1,7 +1,6 @@
import * as echarts from 'echarts/core'
import { BarSeriesOption } from 'echarts/charts'
import { formatByteSize } from '@/util/common'
import { useUpdatedEffect } from '@/util/hooks'
import { r_sys_statistics_storage } from '@/services/system'
import FlexBox from '@/components/common/FlexBox'
import {
@@ -25,7 +24,7 @@ const StorageInfo = () => {
tooltip: { valueFormatter: (value) => formatByteSize(value as number) }
}
useUpdatedEffect(() => {
useEffect(() => {
const chartResizeObserver = new ResizeObserver(() => {
storageInfoEChartsRef.current.forEach((value) => value.resize())
})
@@ -37,7 +36,7 @@ const StorageInfo = () => {
}
}, [storageInfoDivRef.current])
useUpdatedEffect(() => {
useEffect(() => {
const intervalId = setInterval(getStorageInfo(), parseInt(refreshInterval) * 1000)
return () => {

View File

@@ -11,7 +11,6 @@ import {
DATABASE_SELECT_SUCCESS,
DATABASE_UPDATE_SUCCESS
} from '@/constants/common.constants'
import { useUpdatedEffect } from '@/util/hooks'
import { hasPermission } from '@/util/auth'
import { utcToLocalTime, isPastTime, localTimeToUtc, dayjsToUtc, getNowUtc } from '@/util/datetime'
import {
@@ -748,7 +747,7 @@ const User = () => {
}
}, [formValues])
useUpdatedEffect(() => {
useEffect(() => {
getUser()
}, [
JSON.stringify(tableParams.filters),