|
@@ -20,6 +20,7 @@ import (
|
|
|
"qfw/coreconfig"
|
|
|
. "qfw/coreutil"
|
|
|
. "qfw/util"
|
|
|
+ credit "qfw/util/credit"
|
|
|
"qfw/util/elastic"
|
|
|
. "qfw/util/mongodb"
|
|
|
msg "qfw/util/msg"
|
|
@@ -85,7 +86,6 @@ func autoAuth(uid, uname, s_avatar, entid, promotion_id string) {
|
|
|
if len(s_action) == 2 { //已经认证过
|
|
|
return
|
|
|
}
|
|
|
- fmt.Println("222222222222222222222", s_action)
|
|
|
entName := ObjToString((*ent)["EntName"])
|
|
|
email := ObjToString((*ent)["Nb_email"])
|
|
|
t := time.Now().Local().Unix()
|
|
@@ -427,7 +427,7 @@ func (m *Member) RegisterComplete() error {
|
|
|
//登录
|
|
|
func (m *Member) Login() {
|
|
|
var status string = "n"
|
|
|
- var info, freeze string
|
|
|
+ var info, freeze, code string
|
|
|
s_pwd := m.GetString("s_pwd") //密码
|
|
|
if s_pwd != "" { //密码为空不可登录
|
|
|
var loginType string //登录类型
|
|
@@ -448,6 +448,7 @@ func (m *Member) Login() {
|
|
|
} else {
|
|
|
//获取绑定企业信息
|
|
|
if r["s_enterpriseid"] != nil && r["s_enterpriseid"].(string) != "" {
|
|
|
+ code = r["s_enterpriseid"].(string)
|
|
|
//enter := *FindOne("enterprise", `M{"_id":"`+r["s_enterpriseid"].(string)+`"}`)
|
|
|
enter := *FindById("enterprise", r["s_enterpriseid"].(string), nil)
|
|
|
if enter != nil && enter["OpLocDistrict"] != nil {
|
|
@@ -472,7 +473,7 @@ func (m *Member) Login() {
|
|
|
} else {
|
|
|
info = "p_error" //密码错误
|
|
|
}
|
|
|
- m.Write("{\"info\":\"" + info + "\",\"status\":\"" + status + "\",\"freeze\":\"" + freeze + "\"}")
|
|
|
+ m.Write("{\"info\":\"" + info + "\",\"status\":\"" + status + "\",\"freeze\":\"" + freeze + "\",\"code\":\"" + code + "\"}")
|
|
|
}
|
|
|
|
|
|
//找回密码之后直接登录
|
|
@@ -875,12 +876,16 @@ func (m *Member) Bindmail() error {
|
|
|
}
|
|
|
bol := Update("user", M{"_id": ObjectIdHex(m.GetSession("userId").(string))}, M{"$set": updateMap}, false, false)
|
|
|
if bol {
|
|
|
+ //绑邮箱送积分
|
|
|
+ credit.InCreditA(usid, credit.A_BYX, IntAll(m.GetSession("credit_a")))
|
|
|
//邮箱绑定认证
|
|
|
if contype == "1" {
|
|
|
r := *FindById("enterprise", entid, nil)
|
|
|
ac := ObjToString(r["s_action"])
|
|
|
if len(r) > 0 && ac == "" {
|
|
|
autoAuth(usid, uname, avatar, entid, proid)
|
|
|
+ //认证送积分
|
|
|
+ credit.InCreditA(usid, credit.A_RZ, IntAll(m.GetSession("credit_a")))
|
|
|
//发系统消息
|
|
|
msg := &msg.Msg{
|
|
|
Msgtype: 1,
|
|
@@ -1047,6 +1052,8 @@ func (m *Member) Updatephone() error {
|
|
|
if bol {
|
|
|
result = "y"
|
|
|
encryPhone = newPhone
|
|
|
+ //绑定手机送积分
|
|
|
+ credit.InCreditA(ObjToString(m.GetSession("userId")), credit.A_BSJ, IntAll(m.GetSession("credit_a")))
|
|
|
UpdateCookieSession(m.Action, m.GetSession("loginType").(string), false, *FindById("user", m.GetSession("userId").(string), nil))
|
|
|
} else {
|
|
|
result = "n"
|
|
@@ -1121,8 +1128,7 @@ func UpdateSession(action *xweb.Action, r map[string]interface{}) {
|
|
|
setSessMap["identType"] = IntAll(r["i_identificationtype"])
|
|
|
setSessMap["identWay"] = IntAll(r["i_identificationway"])
|
|
|
setSessMap["opLocDistrict"] = r["opLocDistrict"]
|
|
|
- setSessMap["credit_a"] = uint64(IntAll(r["credit_a"]))
|
|
|
-
|
|
|
+ setSessMap["credit_a"] = IntAll(r["credit_a"])
|
|
|
if r["s_phone"] == nil || r["s_phone"].(string) == "" {
|
|
|
setSessMap["phone"] = ""
|
|
|
} else {
|