|
@@ -61,15 +61,19 @@ func (this *OrgStructure) InvitationPage() error {
|
|
|
depId := this.GetString("depId") //加密后-部门id
|
|
|
entId := this.GetString("entId") //加密后-企业id
|
|
|
depcname := this.GetString("depcname")
|
|
|
- registered := "0" //是否是剑鱼用户:0:未关注; 1:已关注
|
|
|
+ registered := "0" //是否是剑鱼用户:0:未关注; 1:已关注
|
|
|
+ entUserId_str := util.SE.Decode4HexByCheck(entUserId) //解密
|
|
|
+ entUserId_sess := this.GetSession("entUserId")
|
|
|
OrgUrl := util.ObjToString(config.Sysconfig["wxOrgUrl"]) + "?entUserId=" + entUserId + "&depId=" + depId + "&entId=" + entId + "&depcname=" + depcname
|
|
|
if !mobileReg.MatchString(client) {
|
|
|
OrgUrl = util.ObjToString(config.Sysconfig["pcOrgUrl"]) + "?entUserId=" + entUserId + "&depId=" + depId + "&entId=" + entId + "&depcname=" + depcname
|
|
|
- } else {
|
|
|
+ } else if entUserId_sess == nil || entUserId_sess.(string) != entUserId_str {
|
|
|
+ userId := util.ObjToString(this.Session().Get("userId"))
|
|
|
openId := util.ObjToString(this.Session().Get("s_m_openid"))
|
|
|
- phone := ""
|
|
|
+ phone := util.ObjToString(this.Session().Get("phone"))
|
|
|
isSubscribe := false //是否关注
|
|
|
- if openId == "" {
|
|
|
+ log.Println("openid:::::::::", openId)
|
|
|
+ if userId == "" {
|
|
|
if this.GetString("state") == "wx" {
|
|
|
//微信跳回来的
|
|
|
code := this.GetString("code")
|
|
@@ -81,6 +85,7 @@ func (this *OrgStructure) InvitationPage() error {
|
|
|
return this.Redirect(fmt.Sprintf(config.Wxoauth, url.QueryEscape(this.Site()+this.Url()), "wx"), 302)
|
|
|
}
|
|
|
}
|
|
|
+ log.Println("openid----------", openId)
|
|
|
if openId != "" {
|
|
|
isSubscribe = CheckUserIsSubscribe(openId)
|
|
|
if isSubscribe {
|
|
@@ -88,11 +93,11 @@ func (this *OrgStructure) InvitationPage() error {
|
|
|
FindUserAndCreateSess(openId, this.Session(), "wx", false)
|
|
|
phone = util.If(this.GetSession("phone") != nil, this.GetSession("phone"), "").(string)
|
|
|
}
|
|
|
- if phone != "" {
|
|
|
- phone = util.SE.EncodeString(phone)
|
|
|
- }
|
|
|
- OrgUrl = OrgUrl + "&openId=" + util.SE.EncodeString(openId) + "&phone=" + phone + "®istered=" + registered
|
|
|
}
|
|
|
+ if phone != "" {
|
|
|
+ phone = util.SE.EncodeString(phone)
|
|
|
+ }
|
|
|
+ OrgUrl = OrgUrl + "&openId=" + util.SE.EncodeString(openId) + "&phone=" + phone + "®istered=" + registered
|
|
|
}
|
|
|
return this.Redirect(OrgUrl)
|
|
|
|