| @@ -177,6 +177,10 @@ | |||||
| <button id="btnGoStep4" type="button" class="btn btn-success btn-sm">下载</button> | <button id="btnGoStep4" type="button" class="btn btn-success btn-sm">下载</button> | ||||
| </div> | </div> | ||||
| <div id="btnStep5" class="btnStep"> | <div id="btnStep5" class="btnStep"> | ||||
| <div class="form-check form-check-inline"> | |||||
| <input class="form-check-input" type="checkbox" id="chkUpdate" name="chkUpdate" value="true"> | |||||
| <label class="form-check-label" for="chkUpdate">自动检查更新</label> | |||||
| </div> | |||||
| <button id="btnOK" type="button" class="btn btn-success btn-sm" data-dismiss="modal">完成</button> | <button id="btnOK" type="button" class="btn btn-success btn-sm" data-dismiss="modal">完成</button> | ||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| @@ -126,5 +126,23 @@ $(document).ready(function() { | |||||
| $("#btnOK").click(function() { | $("#btnOK").click(function() { | ||||
| hasNewVersion(); | hasNewVersion(); | ||||
| }); | }); | ||||
| hasNewVersion(); | |||||
| let shouldCheckUpdate = GetCookie('checkUpdate'); | |||||
| if (shouldCheckUpdate === null) { | |||||
| SetCookie('checkUpdate', 'true', 30); | |||||
| shouldCheckUpdate = 'true'; | |||||
| } | |||||
| if (shouldCheckUpdate === 'true') { | |||||
| hasNewVersion(); | |||||
| $('#chkUpdate').prop('checked', true); | |||||
| } else { | |||||
| $('#chkUpdate').prop('checked', false); | |||||
| } | |||||
| // 模态框关闭时根据复选框状态设置 cookie | |||||
| $('#mdlUpdate').on('hidden.bs.modal', function () { | |||||
| if ($('#chkUpdate').is(':checked')) { | |||||
| SetCookie('checkUpdate', 'true', 30); | |||||
| } else { | |||||
| SetCookie('checkUpdate', 'false', 30); | |||||
| } | |||||
| }); | |||||
| }); | }); | ||||
| @@ -361,8 +361,8 @@ class DedeHttpDown | |||||
| if (count($headers) > 0) { | if (count($headers) > 0) { | ||||
| curl_setopt($this->m_ch, CURLOPT_HTTPHEADER, $headers); | curl_setopt($this->m_ch, CURLOPT_HTTPHEADER, $headers); | ||||
| } | } | ||||
| curl_setopt($this->m_ch, CURLOPT_CONNECTTIMEOUT, 20); | |||||
| curl_setopt($this->m_ch, CURLOPT_TIMEOUT, 900); | |||||
| curl_setopt($this->m_ch, CURLOPT_CONNECTTIMEOUT, 7); | |||||
| curl_setopt($this->m_ch, CURLOPT_TIMEOUT, 10); | |||||
| $this->m_html = curl_exec($this->m_ch); | $this->m_html = curl_exec($this->m_ch); | ||||
| $status = curl_getinfo($this->m_ch); | $status = curl_getinfo($this->m_ch); | ||||
| if (count($status) > 0) { | if (count($status) > 0) { | ||||