diff --git a/ci.json b/ci.json index 290a3f3586..3f2ce494b1 100644 --- a/ci.json +++ b/ci.json @@ -43,7 +43,7 @@ } }, "downgrade": { - "versions": "8.1,7.2,7.1,7.0" + "versions": "8.4,8.1,7.2,7.1,7.0" }, "upload": { "bucket": "download", diff --git a/module/common/model.php b/module/common/model.php index d3dc7d1902..4ed79d0210 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -1143,6 +1143,7 @@ class commonModel extends model if(empty($maintenance)) return true; $maintenance = json_decode($maintenance); + if($this->app->moduleName == 'user' && $this->app->methodName == 'login') return true; if(!empty($this->app->user->admin)) return true; if(isset($maintenance->action) && in_array($maintenance->action, array('upgrade', 'downgrade', 'restore'))) helper::setStatus(503); diff --git a/module/common/test/model/checkmaintenance.php b/module/common/test/model/checkmaintenance.php new file mode 100644 index 0000000000..ce4ca68281 --- /dev/null +++ b/module/common/test/model/checkmaintenance.php @@ -0,0 +1,40 @@ +#!/usr/bin/env php +loadModel('common'); + +$app->moduleName = 'user'; +$app->methodName = 'login'; +r($tester->common->checkMaintenance()) && p() && e('1'); // 检查是否处于维护状态 + +$app->moduleName = 'execution'; +$app->methodName = 'task'; +r($tester->common->checkMaintenance()) && p() && e('1'); // 检查是否处于维护状态 + +$app->moduleName = 'program'; +$app->methodName = 'view'; +r($tester->common->checkMaintenance()) && p() && e('1'); // 检查是否处于维护状态 + +$app->moduleName = 'bug'; +$app->methodName = 'view'; +r($tester->common->checkMaintenance()) && p() && e('1'); // 检查是否处于维护状态 + +$app->moduleName = 'task'; +$app->methodName = 'view'; +r($tester->common->checkMaintenance()) && p() && e('1'); // 检查是否处于维护状态