作者 tangxvhui

bug 修复

... ... @@ -156,7 +156,10 @@ func (c *AuthController) LoginSecretKey() {
}
logintoken, err := serveauth.LoginAuthBySecretKey(param.Secret)
if err != nil {
msg = protocol.NewReturnResponse(nil, err)
msg = &protocol.ResponseMessage{
Errno: -1,
Errmsg: err.Error(),
}
return
}
err = serveauth.ResetLoginToken(logintoken)
... ...
... ... @@ -584,7 +584,12 @@ func LoginAuthBySecretKey(secretKey string) (protocol.LoginAuthToken, error) {
var uclientReturn *ucenter.ResponseLogin
uclientReturn, err = ucenter.RequestUCenterLoginBySecret(secretKey)
if err != nil {
return logintoken, protocol.NewErrWithMessage("1")
return logintoken, protocol.ErrWithMessage{
ErrorCode: protocol.ErrorCode{
Errno: "-1",
Errmsg: uclientReturn.Msg,
},
}
}
userdata, err = models.GetUserByPhone(uclientReturn.Data.Phone)
if err != nil {
... ...
... ... @@ -189,13 +189,13 @@ func SelectCompanyUserList(pageIndex int, pageSize int, companyid int64, userNam
LEFT JOIN user_department AS b ON a.id = b.user_company_id AND b.enable_status=1
LEFT JOIN department AS c ON b.department_id = c.id
LEFT JOIN user AS d ON a.user_id = d.id
WHERE a.delete_at = 0 AND a.enable=1 AND c.company_id = ? `
WHERE a.delete_at = 0 AND a.enable=1 AND a.company_id = ? `
countsql := `SELECT count(*)
FROM user_company AS a
LEFT JOIN user_department AS b ON a.id = b.user_company_id AND b.enable_status=1
LEFT JOIN department AS c ON b.department_id = c.id
LEFT JOIN user AS d ON a.user_id = d.id
WHERE a.delete_at = 0 AND a.enable=1 AND c.company_id =? `
WHERE a.delete_at = 0 AND a.enable=1 AND a.company_id =? `
cond := []interface{}{companyid}
where := ""
if len(userName) > 0 {
... ...
... ... @@ -384,7 +384,8 @@ func getDataForRankRnageRelation(companyid int64, rangeType int8, relationId []i
)
qs := o.QueryTable(&models.UserCompany{}).
Filter("delete_at", 0).
Filter("company_id", companyid)
Filter("company_id", companyid).
Filter("enable", 1)
if len(relationId) > 0 {
qs = qs.Filter("id__in", relationId)
}
... ... @@ -400,8 +401,7 @@ func getDataForRankRnageRelation(companyid int64, rangeType int8, relationId []i
)
qs := o.QueryTable(&models.Department{}).
Filter("delete_at", 0).
Filter("company_id", companyid).
Filter("is_top", 0)
Filter("company_id", companyid)
if len(relationId) > 0 {
qs = qs.Filter("id__in", relationId)
}
... ...
... ... @@ -51,7 +51,7 @@ func RequestUCenterLoginBySecret(secret string) (*ResponseLogin, error) {
return nil, protocol.NewErrWithMessage("1")
}
if !(uclientReturn.Code == ResponseCode0) {
return nil, protocol.NewErrWithMessage("10052")
return &uclientReturn, protocol.NewErrWithMessage("1")
}
return &uclientReturn, nil
}
... ...