Skip to content

Commit

Permalink
update: 0 change to config.SysDisable
Browse files Browse the repository at this point in the history
  • Loading branch information
Trevor-Lan committed Aug 28, 2022
1 parent 70eeb8d commit 5da1e9f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion app/core/cmd/api/internal/logic/sys/job/updatesysjoblogic.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (

"ark-admin-zero/app/core/cmd/api/internal/svc"
"ark-admin-zero/app/core/cmd/api/internal/types"
"ark-admin-zero/common/config"
"ark-admin-zero/common/errorx"

"github.com/jinzhu/copier"
Expand All @@ -31,7 +32,7 @@ func (l *UpdateSysJobLogic) UpdateSysJob(req *types.UpdateSysJobReq) error {
return errorx.NewDefaultError(errorx.JobIdErrorCode)
}

if req.Status == 0 {
if req.Status == config.SysDisable {
count, _ := l.svcCtx.SysUserModel.FindCountByJobId(l.ctx, req.Id)
if count > 0 {
return errorx.NewDefaultError(errorx.JobIsUsingErrorCode)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (

"ark-admin-zero/app/core/cmd/api/internal/svc"
"ark-admin-zero/app/core/cmd/api/internal/types"
"ark-admin-zero/common/config"
"ark-admin-zero/common/errorx"

"github.com/jinzhu/copier"
Expand All @@ -31,7 +32,7 @@ func (l *UpdateSysProfessionLogic) UpdateSysProfession(req *types.UpdateSysProfe
return errorx.NewDefaultError(errorx.ProfessionIdErrorCode)
}

if req.Status == 0 {
if req.Status == config.SysDisable {
count, _ := l.svcCtx.SysUserModel.FindCountByProfessionId(l.ctx, req.Id)
if count > 0 {
return errorx.NewDefaultError(errorx.JobIsUsingErrorCode)
Expand Down
2 changes: 1 addition & 1 deletion app/core/cmd/api/internal/logic/user/loginlogic.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func (l *LoginLogic) Login(req *types.LoginReq, r *http.Request) (resp *types.Lo

if sysUser.Id != config.SysProtectUserId {
dept, _ := l.svcCtx.SysDeptModel.FindOne(l.ctx, sysUser.DeptId)
if dept.Status == 0 {
if dept.Status == config.SysDisable {
return nil, errorx.NewDefaultError(errorx.AccountDisableErrorCode)
}
}
Expand Down

0 comments on commit 5da1e9f

Please sign in to comment.