You've already forked EasyImages2.0
mirror of
https://github.com/icret/EasyImages2.0.git
synced 2025-12-16 11:53:58 +08:00
修复局域网无法获取新版本时导致的页面混乱[#91](https://github.com/icret/EasyImages2.0/issues/91#issue-1585360193)
This commit is contained in:
@@ -853,17 +853,21 @@ function getVersion($name = 'tag_name')
|
||||
global $config;
|
||||
|
||||
if ($config['checkEnv']) {
|
||||
|
||||
require_once APP_ROOT . '/application/class.version.php';
|
||||
$url = "https://api.github.com/repositories/188228357/releases/latest"; // 获取版本地址
|
||||
$getVersion = new getVersion($url);
|
||||
|
||||
if (!empty($getVersion->readJson($name))) {
|
||||
return $getVersion->readJson($name); // 返回版本信息
|
||||
} else {
|
||||
try {
|
||||
if (!empty($getVersion->readJson($name))) {
|
||||
return $getVersion->readJson($name); // 返回版本信息
|
||||
} else {
|
||||
return '存在版本文件, 但是内容为空,请等待1小时候后再次更新版本号!';
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
$getVersion->downJson(); // 获取版本信息
|
||||
return '获取版本文件失败,请检查curl或者网络';
|
||||
return '获取版本文件失败,请检查curl或者网络 错误信息: ' . $e->getMessage();
|
||||
}
|
||||
} else {
|
||||
return '已关闭环境自检, 当前版本:' . get_current_version();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user