Browse Source

Merge branch 'develop' into adminsite

adminsite
叙述、别离 2 days ago
parent
commit
5e3ad1cedc
3 changed files with 25 additions and 3 deletions
  1. +4
    -0
      src/admin/templets/index_body.htm
  2. +19
    -1
      src/static/web/js/admin.update.js
  3. +2
    -2
      src/system/libraries/dedehttpdown.class.php

+ 4
- 0
src/admin/templets/index_body.htm View File

@@ -177,6 +177,10 @@
<button id="btnGoStep4" type="button" class="btn btn-success btn-sm">下载</button>
</div>
<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>
</div>
</div>


+ 19
- 1
src/static/web/js/admin.update.js View File

@@ -126,5 +126,23 @@ $(document).ready(function() {
$("#btnOK").click(function() {
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);
}
});
});

+ 2
- 2
src/system/libraries/dedehttpdown.class.php View File

@@ -361,8 +361,8 @@ class DedeHttpDown
if (count($headers) > 0) {
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);
$status = curl_getinfo($this->m_ch);
if (count($status) > 0) {


Loading…
Cancel
Save