mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-23 14:56:07 +08:00
修复定时任务详情页查看历史日志异常
This commit is contained in:
parent
c35cfba8b0
commit
5e73f0390f
|
@ -120,10 +120,11 @@ const CronDetailModal = ({
|
|||
};
|
||||
|
||||
const onClickItem = (item: LogItem) => {
|
||||
localStorage.setItem('logCron', currentCron.id);
|
||||
setLogUrl(
|
||||
`${config.apiPrefix}logs/${item.filename}?path=${item.directory || ''}`,
|
||||
);
|
||||
const url = `${config.apiPrefix}logs/${item.filename}?path=${
|
||||
item.directory || ''
|
||||
}`;
|
||||
localStorage.setItem('logCron', url);
|
||||
setLogUrl(url);
|
||||
request
|
||||
.get(
|
||||
`${config.apiPrefix}logs/${item.filename}?path=${item.directory || ''}`,
|
||||
|
|
|
@ -40,6 +40,7 @@ const CronLogModal = ({
|
|||
const [executing, setExecuting] = useState<any>(true);
|
||||
const [isPhone, setIsPhone] = useState(false);
|
||||
const scrollInfoRef = useRef({ value: 0, down: true });
|
||||
const uniqPath = logUrl ? logUrl : String(cron?.id);
|
||||
|
||||
const getCronLog = (isFirst?: boolean) => {
|
||||
if (isFirst) {
|
||||
|
@ -50,7 +51,7 @@ const CronLogModal = ({
|
|||
.then(({ code, data }) => {
|
||||
if (
|
||||
code === 200 &&
|
||||
localStorage.getItem('logCron') === String(cron.id) &&
|
||||
localStorage.getItem('logCron') === uniqPath &&
|
||||
data !== value
|
||||
) {
|
||||
const log = data as string;
|
||||
|
|
Loading…
Reference in New Issue
Block a user