...
|
...
|
@@ -328,21 +328,21 @@ func Authorize(header *protocol.RequestHeader, request *protocol.AuthorizeReques |
|
|
//权限验证 判断用户公司是否存在
|
|
|
if userCompany, err = models.GetUserCompanyById(request.Muid); err != nil {
|
|
|
log.Error(err, request.Muid)
|
|
|
err = protocol.NewErrWithMessage(2002, err) //TODO:用户不存在
|
|
|
err = protocol.NewErrWithMessage(10008, err) //用户无模块权限
|
|
|
return
|
|
|
}
|
|
|
if userCompany.Enable != 1 {
|
|
|
err = protocol.NewErrWithMessage(2002, err) //TODO:用户无权限
|
|
|
err = protocol.NewErrWithMessage(10006, err) //用户已禁用
|
|
|
log.Error(err)
|
|
|
return
|
|
|
}
|
|
|
if company, err = models.GetCompanyById(request.Cid); err != nil || company.Enable != 1 {
|
|
|
if company, err = models.GetCompanyById(request.Cid); err != nil {
|
|
|
log.Error(err, request.Cid)
|
|
|
err = protocol.NewErrWithMessage(2002, err) //TODO:公司模块不存在
|
|
|
err = protocol.NewErrWithMessage(10007, err) //企业已禁用
|
|
|
return
|
|
|
}
|
|
|
if company.Enable != 1 {
|
|
|
err = protocol.NewErrWithMessage(2002, err) //TODO:公司模块被禁用
|
|
|
err = protocol.NewErrWithMessage(10007, err) ///企业已禁用
|
|
|
log.Error(err)
|
|
|
return
|
|
|
}
|
...
|
...
|
|