|
@@ -398,23 +398,25 @@ func (this *UserController) CheckLogin() {
|
|
|
this.Data["json"] = br
|
|
|
this.ServeJSON()
|
|
|
}()
|
|
|
- if this.User == nil {
|
|
|
+ user := this.User
|
|
|
+ if user == nil {
|
|
|
br.Msg = "请登录"
|
|
|
br.ErrMsg = "请登录"
|
|
|
br.Ret = 408
|
|
|
return
|
|
|
}
|
|
|
- uid := this.User.UserId
|
|
|
+
|
|
|
+ uid := user.UserId
|
|
|
resp := new(models.CheckStatusResp)
|
|
|
if uid > 0 {
|
|
|
//判断token是否过期
|
|
|
- userItem, err := models.GetWxUserItemByUserId(uid)
|
|
|
+ userRecord, err := models.GetUserRecordByUserId(uid, utils.WxPlatform)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取用户信息失败"
|
|
|
br.ErrMsg = "获取用户信息失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
- permissionStr, err := models.GetCompanyPermission(userItem.CompanyId)
|
|
|
+ permissionStr, err := models.GetCompanyPermission(user.CompanyId)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取信息失败"
|
|
|
br.ErrMsg = "获取客户信息失败,Err:" + err.Error()
|
|
@@ -422,10 +424,10 @@ func (this *UserController) CheckLogin() {
|
|
|
}
|
|
|
resp.PermissionName = permissionStr
|
|
|
|
|
|
- if userItem.Mobile == "" && userItem.Email == "" {
|
|
|
+ if user.Mobile == "" && user.Email == "" {
|
|
|
resp.IsBind = true
|
|
|
}
|
|
|
- if userItem.UnionId == "" {
|
|
|
+ if userRecord.UnionId == "" {
|
|
|
resp.IsAuth = true
|
|
|
}
|
|
|
} else {
|
|
@@ -850,7 +852,7 @@ func (this *UserController) ApplyTryOut() {
|
|
|
}
|
|
|
cnf, _ := models.GetConfigByCode("tpl_msg")
|
|
|
if cnf != nil {
|
|
|
- openIpItem, _ := models.GetWxUserItemByMobile(cnf.ConfigValue)
|
|
|
+ openIpItem, _ := models.GetUserRecordByUserId(user.UserId, 1)
|
|
|
if openIpItem != nil && openIpItem.OpenId != "" {
|
|
|
go services.SendPermissionApplyTemplateMsg(user.RealName, sellerItem.CompanyName, mobile, openIpItem.OpenId, applyMethod)
|
|
|
}
|