@@ -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> | ||||
@@ -4112,4 +4112,4 @@ INSERT INTO `#@__sysconfig` (`varname`, `info`, `groupid`, `type`, `value`) VALU | |||||
INSERT INTO `#@__sysconfig` (`varname`, `info`, `groupid`, `type`, `value`) VALUES ('cfg_ai_max_tokens', '最大令牌数(为空则不限,默认采用模型默认值)', 8, 'string', ''); | INSERT INTO `#@__sysconfig` (`varname`, `info`, `groupid`, `type`, `value`) VALUES ('cfg_ai_max_tokens', '最大令牌数(为空则不限,默认采用模型默认值)', 8, 'string', ''); | ||||
INSERT INTO `#@__sysconfig` (`varname`, `info`, `groupid`, `type`, `value`) VALUES ('cfg_ai_temperature', '采样温度(为空则采用模型默认值)', 8, 'string', ''); | INSERT INTO `#@__sysconfig` (`varname`, `info`, `groupid`, `type`, `value`) VALUES ('cfg_ai_temperature', '采样温度(为空则采用模型默认值)', 8, 'string', ''); | ||||
INSERT INTO `#@__sysconfig` (`varname`, `info`, `groupid`, `type`, `value`) VALUES ('cfg_ai_top_p', '核采样(为空则采用模型默认值)', 8, 'string', ''); | INSERT INTO `#@__sysconfig` (`varname`, `info`, `groupid`, `type`, `value`) VALUES ('cfg_ai_top_p', '核采样(为空则采用模型默认值)', 8, 'string', ''); | ||||
INSERT INTO `#@__sysconfig` (`varname`, `info`, `groupid`, `type`, `value`) VALUES ('cfg_ai_enabled', '是否开启智能助手', 8, 'bool', 'Y'); | |||||
INSERT INTO `#@__sysconfig` (`varname`, `info`, `groupid`, `type`, `value`) VALUES ('cfg_ai_enabled', '是否开启AI功能', 8, 'bool', 'Y'); |
@@ -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); | |||||
} | |||||
}); | |||||
}); | }); |
@@ -72,7 +72,7 @@ if (!function_exists('GetFileUrl')) { | |||||
if ($moresite == 1) { | if ($moresite == 1) { | ||||
$articleUrl = preg_replace("#^".$sitepath.'#', '', $articleUrl); | $articleUrl = preg_replace("#^".$sitepath.'#', '', $articleUrl); | ||||
} | } | ||||
if (!preg_match("/http:/", $articleUrl)) { | |||||
if (!preg_match("/^(http|https):\/\//", $articleUrl)) { | |||||
$articleUrl = $siteurl.$articleUrl; | $articleUrl = $siteurl.$articleUrl; | ||||
} | } | ||||
} | } | ||||
@@ -612,7 +612,7 @@ function GetHotKeywords(&$dsql, $num = 8, $nday = 365, $klen = 16, $orderby = 'c | |||||
*/ | */ | ||||
function Gmapurl($gurl) | function Gmapurl($gurl) | ||||
{ | { | ||||
return preg_match("/http[s]?:\/\//i", $gurl) ? $gurl : $GLOBALS['cfg_basehost'].$gurl; | |||||
return preg_match("#^(http|https):\/\/#i", $gurl) ? $gurl : $GLOBALS['cfg_basehost'].$gurl; | |||||
} | } | ||||
/** | /** | ||||
* 引用回复标记处理 | * 引用回复标记处理 | ||||
@@ -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) { | ||||