|
@@ -44,6 +44,7 @@ func Login(header *protocol.RequestHeader, request *protocol.LoginRequest) (rsp |
|
@@ -44,6 +44,7 @@ func Login(header *protocol.RequestHeader, request *protocol.LoginRequest) (rsp |
44
|
getUserResponse *protocol.UCenterGetUserResponse
|
44
|
getUserResponse *protocol.UCenterGetUserResponse
|
45
|
message *protocol.Message
|
45
|
message *protocol.Message
|
46
|
company *models.Company
|
46
|
company *models.Company
|
|
|
47
|
+ companys []*models.Company
|
47
|
)
|
48
|
)
|
48
|
user, err = models.GetUserByUcenterId(id)
|
49
|
user, err = models.GetUserByUcenterId(id)
|
49
|
if err != nil {
|
50
|
if err != nil {
|
|
@@ -51,6 +52,15 @@ func Login(header *protocol.RequestHeader, request *protocol.LoginRequest) (rsp |
|
@@ -51,6 +52,15 @@ func Login(header *protocol.RequestHeader, request *protocol.LoginRequest) (rsp |
51
|
err = protocol.NewErrWithMessage(2002, err) //账号不存在
|
52
|
err = protocol.NewErrWithMessage(2002, err) //账号不存在
|
52
|
return
|
53
|
return
|
53
|
}
|
54
|
}
|
|
|
55
|
+ if companys, err = models.GetCompanyByPermission(user.Id); err != nil {
|
|
|
56
|
+ log.Error(err)
|
|
|
57
|
+ err = protocol.NewErrWithMessage(2002, err) //账号不存在
|
|
|
58
|
+ return
|
|
|
59
|
+ }
|
|
|
60
|
+ if len(companys) == 0 {
|
|
|
61
|
+ err = protocol.NewErrWithMessage(2002, err) //账号不存在
|
|
|
62
|
+ return
|
|
|
63
|
+ }
|
54
|
if !utils.ValidVersion(header.Version, protocol.RequireVersion) {
|
64
|
if !utils.ValidVersion(header.Version, protocol.RequireVersion) {
|
55
|
log.Warn(fmt.Sprintf("版本不足 当前手机版本:%v 需要版本大于:%v", header.Version, protocol.RequireVersion))
|
65
|
log.Warn(fmt.Sprintf("版本不足 当前手机版本:%v 需要版本大于:%v", header.Version, protocol.RequireVersion))
|
56
|
err = protocol.NewCustomMessage(2002, "版本不足,请升级app") //账号不存在
|
66
|
err = protocol.NewCustomMessage(2002, "版本不足,请升级app") //账号不存在
|