feat: 完成端口修改功能
This commit is contained in:
@@ -10,13 +10,13 @@ import (
|
||||
func GlobalLoading() gin.HandlerFunc {
|
||||
return func(c *gin.Context) {
|
||||
settingRepo := repo.NewISettingRepo()
|
||||
upgradeSetting, err := settingRepo.Get(settingRepo.WithByKey("SystemVersion"))
|
||||
status, err := settingRepo.Get(settingRepo.WithByKey("SystemStatus"))
|
||||
if err != nil {
|
||||
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
|
||||
return
|
||||
}
|
||||
if upgradeSetting.Value == constant.StatusWaiting {
|
||||
helper.ErrorWithDetail(c, constant.CodeGlobalLoading, "Upgrading", err)
|
||||
if status.Value != "Free" {
|
||||
helper.ErrorWithDetail(c, constant.CodeGlobalLoading, status.Value, err)
|
||||
return
|
||||
}
|
||||
c.Next()
|
||||
|
||||
Reference in New Issue
Block a user