作者 tangxvhui

bug 修复

@@ -156,7 +156,10 @@ func (c *AuthController) LoginSecretKey() { @@ -156,7 +156,10 @@ func (c *AuthController) LoginSecretKey() {
156 } 156 }
157 logintoken, err := serveauth.LoginAuthBySecretKey(param.Secret) 157 logintoken, err := serveauth.LoginAuthBySecretKey(param.Secret)
158 if err != nil { 158 if err != nil {
159 - msg = protocol.NewReturnResponse(nil, err) 159 + msg = &protocol.ResponseMessage{
  160 + Errno: -1,
  161 + Errmsg: err.Error(),
  162 + }
160 return 163 return
161 } 164 }
162 err = serveauth.ResetLoginToken(logintoken) 165 err = serveauth.ResetLoginToken(logintoken)
@@ -584,7 +584,12 @@ func LoginAuthBySecretKey(secretKey string) (protocol.LoginAuthToken, error) { @@ -584,7 +584,12 @@ func LoginAuthBySecretKey(secretKey string) (protocol.LoginAuthToken, error) {
584 var uclientReturn *ucenter.ResponseLogin 584 var uclientReturn *ucenter.ResponseLogin
585 uclientReturn, err = ucenter.RequestUCenterLoginBySecret(secretKey) 585 uclientReturn, err = ucenter.RequestUCenterLoginBySecret(secretKey)
586 if err != nil { 586 if err != nil {
587 - return logintoken, protocol.NewErrWithMessage("1") 587 + return logintoken, protocol.ErrWithMessage{
  588 + ErrorCode: protocol.ErrorCode{
  589 + Errno: "-1",
  590 + Errmsg: uclientReturn.Msg,
  591 + },
  592 + }
588 } 593 }
589 userdata, err = models.GetUserByPhone(uclientReturn.Data.Phone) 594 userdata, err = models.GetUserByPhone(uclientReturn.Data.Phone)
590 if err != nil { 595 if err != nil {
@@ -189,13 +189,13 @@ func SelectCompanyUserList(pageIndex int, pageSize int, companyid int64, userNam @@ -189,13 +189,13 @@ func SelectCompanyUserList(pageIndex int, pageSize int, companyid int64, userNam
189 LEFT JOIN user_department AS b ON a.id = b.user_company_id AND b.enable_status=1 189 LEFT JOIN user_department AS b ON a.id = b.user_company_id AND b.enable_status=1
190 LEFT JOIN department AS c ON b.department_id = c.id 190 LEFT JOIN department AS c ON b.department_id = c.id
191 LEFT JOIN user AS d ON a.user_id = d.id 191 LEFT JOIN user AS d ON a.user_id = d.id
192 - WHERE a.delete_at = 0 AND a.enable=1 AND c.company_id = ? ` 192 + WHERE a.delete_at = 0 AND a.enable=1 AND a.company_id = ? `
193 countsql := `SELECT count(*) 193 countsql := `SELECT count(*)
194 FROM user_company AS a 194 FROM user_company AS a
195 LEFT JOIN user_department AS b ON a.id = b.user_company_id AND b.enable_status=1 195 LEFT JOIN user_department AS b ON a.id = b.user_company_id AND b.enable_status=1
196 LEFT JOIN department AS c ON b.department_id = c.id 196 LEFT JOIN department AS c ON b.department_id = c.id
197 LEFT JOIN user AS d ON a.user_id = d.id 197 LEFT JOIN user AS d ON a.user_id = d.id
198 - WHERE a.delete_at = 0 AND a.enable=1 AND c.company_id =? ` 198 + WHERE a.delete_at = 0 AND a.enable=1 AND a.company_id =? `
199 cond := []interface{}{companyid} 199 cond := []interface{}{companyid}
200 where := "" 200 where := ""
201 if len(userName) > 0 { 201 if len(userName) > 0 {
@@ -384,7 +384,8 @@ func getDataForRankRnageRelation(companyid int64, rangeType int8, relationId []i @@ -384,7 +384,8 @@ func getDataForRankRnageRelation(companyid int64, rangeType int8, relationId []i
384 ) 384 )
385 qs := o.QueryTable(&models.UserCompany{}). 385 qs := o.QueryTable(&models.UserCompany{}).
386 Filter("delete_at", 0). 386 Filter("delete_at", 0).
387 - Filter("company_id", companyid) 387 + Filter("company_id", companyid).
  388 + Filter("enable", 1)
388 if len(relationId) > 0 { 389 if len(relationId) > 0 {
389 qs = qs.Filter("id__in", relationId) 390 qs = qs.Filter("id__in", relationId)
390 } 391 }
@@ -400,8 +401,7 @@ func getDataForRankRnageRelation(companyid int64, rangeType int8, relationId []i @@ -400,8 +401,7 @@ func getDataForRankRnageRelation(companyid int64, rangeType int8, relationId []i
400 ) 401 )
401 qs := o.QueryTable(&models.Department{}). 402 qs := o.QueryTable(&models.Department{}).
402 Filter("delete_at", 0). 403 Filter("delete_at", 0).
403 - Filter("company_id", companyid).  
404 - Filter("is_top", 0) 404 + Filter("company_id", companyid)
405 if len(relationId) > 0 { 405 if len(relationId) > 0 {
406 qs = qs.Filter("id__in", relationId) 406 qs = qs.Filter("id__in", relationId)
407 } 407 }
@@ -51,7 +51,7 @@ func RequestUCenterLoginBySecret(secret string) (*ResponseLogin, error) { @@ -51,7 +51,7 @@ func RequestUCenterLoginBySecret(secret string) (*ResponseLogin, error) {
51 return nil, protocol.NewErrWithMessage("1") 51 return nil, protocol.NewErrWithMessage("1")
52 } 52 }
53 if !(uclientReturn.Code == ResponseCode0) { 53 if !(uclientReturn.Code == ResponseCode0) {
54 - return nil, protocol.NewErrWithMessage("10052") 54 + return &uclientReturn, protocol.NewErrWithMessage("1")
55 } 55 }
56 return &uclientReturn, nil 56 return &uclientReturn, nil
57 } 57 }