Skip to content

Commit

Permalink
https://github.com/zhaopeiym/quartzui/issues/73#issuecomment-1090075047
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaopeiym committed Apr 25, 2022
1 parent 39e544c commit cebb805
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion QuartzNetAPI/Host/Controllers/SetingController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ private async Task<UpdateLoginInfoEntity> GetLoginAsync()
[HttpPost]
public async Task<RefreshIntervalEntity> GetRefreshInterval()
{
return JsonConvert.DeserializeObject<RefreshIntervalEntity>(await System.IO.File.ReadAllTextAsync(refreshIntervalPath));
return JsonConvert.DeserializeObject<RefreshIntervalEntity>(await System.IO.File.ReadAllTextAsync(refreshIntervalPath)) ?? new RefreshIntervalEntity();
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion QuartzNetAPI/Host/Entity/RefreshIntervalEntity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ public class RefreshIntervalEntity
/// <summary>
/// 间隔时间
/// </summary>
public int IntervalTime { get; set; }
public int IntervalTime { get; set; } = 10;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,10 @@ export class TaskListComponent implements OnInit {
getRefreshInterval() {
var url = this.baseUrl + "/api/Seting/GetRefreshInterval";
this.http.post(url, {}, (result: any) => {
this.refreshValue = result.intervalTime * 1000;
if (!result || result.intervalTime === null || result.intervalTime === undefined)
this.refreshValue = 10 * 1000;
else
this.refreshValue = result.intervalTime * 1000;
}, (err) => {

});
Expand Down

0 comments on commit cebb805

Please sign in to comment.