作者 yangfu

获取用户信息修改

... ... @@ -548,6 +548,10 @@ type Picture struct {
//JobId string `json:"job_id"`
}
type Avatar struct {
Path string `json:"path"`
}
//视频
type Video struct {
Path string `json:"path"`
... ...
... ... @@ -13,6 +13,10 @@ var errmessge ErrorMap = map[int]string{
5: "繁忙,请稍后再试",
101: "clientId或clientSecret无效",
113: "签名验证失败",
502: "用户不存在",
503: "用户被禁用",
601: "公司被禁用",
602: "用户无模块权限",
1009: "验证码已失效",
1011: "获取验证码次数超出限制,请联系管理员",
1012: "请输入正确的验证码",
... ...
... ... @@ -64,14 +64,14 @@ type UserStatisticsResponse struct {
}
type User struct {
UserId int64 `json:"uid"`
MUserId int64 `json:"muid"` //中台用户ID
Name string `json:"uname"`
Phone string `json:"phone"`
Image Picture `json:"image"`
Department Dep `json:"dep"`
Position Job `json:"job"`
ImToken string `json:"imToken"`
UserId int64 `json:"uid"`
MUserId int64 `json:"muid"` //中台用户ID
Name string `json:"uname"`
Phone string `json:"phone"`
Image Avatar `json:"image"`
Department Dep `json:"dep"`
Position Job `json:"job"`
ImToken string `json:"imToken"`
//companys
CompanyId int `json:"companyId"`
... ...
... ... @@ -302,6 +302,11 @@ func Authorize(header *protocol.RequestHeader, request *protocol.AuthorizeReques
userCompany *models.UserCompany
company *models.Company
)
//验证 当前登录的公司是否有模块权限
if err = CheckBusinessAuth(header, request.Muid); err != nil {
log.Error(request.Muid, err)
return
}
//判断用户是否添加
user, err = models.GetUserByUcenterId(id)
if err != nil {
... ... @@ -347,11 +352,6 @@ func Authorize(header *protocol.RequestHeader, request *protocol.AuthorizeReques
err = protocol.NewCustomMessage(2002, "版本不足,请升级app") //账号不存在
return
}
//验证 当前登录的公司是否有模块权限
if err = CheckBusinessAuth(header, request.Muid); err != nil {
log.Error(request.Muid, err)
return
}
//获取最后一次公司编号给统一用户中心
//if u, e := models.GetUserAuthByUserId(user.Id, protocol.DeviceType); e == nil && user.UserCenterId == id {
// if currentCompany, e = models.GetCompanyById(u.CurrentCompanyId); e == nil {
... ...
... ... @@ -361,10 +361,8 @@ func UserInfo(header *protocol.RequestHeader, request *protocol.UserInfoRequest)
MUserId: header.UserId,
Name: userBaseAgg.User.NickName,
Phone: userBaseAgg.User.Phone,
Image: protocol.Picture{
Image: protocol.Avatar{
Path: userBaseAgg.User.Icon,
H: 0,
W: 0,
},
ImToken: userBaseAgg.User.ImToken,
CompanyId: int(companyId),
... ... @@ -475,13 +473,12 @@ func UserInfoV3(header *protocol.RequestHeader, request *protocol.UserInfoReques
}
rsp = &protocol.UserInfoResponse{
User: protocol.User{
UserId: header.UserId,
Name: userBaseAgg.User.NickName,
Phone: userBaseAgg.User.Phone,
Image: protocol.Picture{
UserId: header.UserId,
MUserId: header.UserId,
Name: userBaseAgg.User.NickName,
Phone: userBaseAgg.User.Phone,
Image: protocol.Avatar{
Path: userBaseAgg.User.Icon,
H: 0,
W: 0,
},
ImToken: userBaseAgg.User.ImToken,
CompanyId: int(companyId),
... ...