Procházet zdrojové kódy

Merge branch 'release' of 192.168.3.17:zhanghongbo/qfw into release

wangshan před 9 roky
rodič
revize
0fe91d1bf6

+ 24 - 21
core/src/qfw/member/membermanager.go

@@ -216,7 +216,8 @@ func (m *Member) GetLogin(key string) error {
 				}
 			}
 			if bcon {
-				UpdateCookieSession(m.Action, "s_nickname", false, *user)
+				UpdateCookieSession(m.Action, "s_name", false, *user)
+				updateAudittype(m.Action, user)
 				flag := 0
 				if redis.GetStr("sso", "new_"+key) == res {
 					flag = 1
@@ -424,6 +425,14 @@ func (m *Member) RegisterComplete() error {
 	return m.Render("/member/registercomplete.html", &m.T)
 }
 
+func updateAudittype(action *xweb.Action, r *map[string]interface{}) {
+	if action.GetSession("audittype") == "y" {
+		Update("user", &map[string]interface{}{
+			"_id": ObjectIdHex(strings.Split(fmt.Sprintf("%s", (*r)["_id"]), `"`)[1]),
+		}, `{'$set':{'s_audittype':'n'}}`, false, false)
+	}
+}
+
 //登录
 func (m *Member) Login() {
 	var status string = "n"
@@ -432,42 +441,36 @@ func (m *Member) Login() {
 	if s_pwd != "" {              //密码为空不可登录
 		var loginType string            //登录类型
 		s_name := m.GetString("s_name") //用户名
-		r := *FindOne("user", M{"$or": []M{M{"s_name": s_name}, M{"s_phone": s_name}, M{"s_email": s_name}}})
-		if r == nil || len(r) == 0 {
+		r := FindOne("user", M{"$or": []M{M{"s_name": s_name}, M{"s_phone": s_name}, M{"s_email": s_name}}})
+		if r == nil || len(*r) == 0 {
 			info = "s_error" //用户不存在
 		} else {
-			if s_name == r["s_name"].(string) {
+			if s_name == (*r)["s_name"].(string) {
 				loginType = "s_name"
-			} else if r["s_phone"] != nil && s_name == r["s_phone"].(string) {
+			} else if (*r)["s_phone"] != nil && s_name == (*r)["s_phone"].(string) {
 				loginType = "s_phone" //手机登录
-			} else if r["s_email"] != nil && s_name == r["s_email"].(string) {
+			} else if (*r)["s_email"] != nil && s_name == (*r)["s_email"].(string) {
 				loginType = "s_email" //邮箱登录
 			}
-			if GetMd5String(s_pwd) != r["s_pwd"] {
+			if GetMd5String(s_pwd) != (*r)["s_pwd"] {
 				info = "p_error" //密码错误
 			} else {
 				//获取绑定企业信息
-				if r["s_enterpriseid"] != nil && r["s_enterpriseid"].(string) != "" {
-					code = r["s_enterpriseid"].(string)
+				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)
+					enter := *FindById("enterprise", (*r)["s_enterpriseid"].(string), nil)
 					if enter != nil && enter["OpLocDistrict"] != nil {
-						r["opLocDistrict"] = enter["OpLocDistrict"]
+						(*r)["opLocDistrict"] = enter["OpLocDistrict"]
 					}
 				}
-				status = strconv.Itoa(r["i_type"].(int)) //用户类型
-				freeze = fmt.Sprint(r["i_freeze"])       //冻结状态
+				status = strconv.Itoa((*r)["i_type"].(int)) //用户类型
+				freeze = fmt.Sprint((*r)["i_freeze"])       //冻结状态
 				if freeze != "2" {
 					//更新session、cookie
-					UpdateCookieSession(m.Action, loginType, m.GetString("rememberMe") == "y", r)
-				}
-				stype := m.GetSession("audittype")
-				r_id := strings.Split(fmt.Sprintf("%s", r["_id"]), `"`)[1]
-				if stype == "y" {
-					Update("user", &map[string]interface{}{
-						"_id": ObjectIdHex(r_id),
-					}, `{'$set':{'s_audittype':'n'}}`, false, false)
+					UpdateCookieSession(m.Action, loginType, m.GetString("rememberMe") == "y", *r)
 				}
+				updateAudittype(m.Action, r)
 			}
 		}
 	} else {

binární
core/src/web/staticres/images/choujiang.png


+ 54 - 55
core/src/web/templates/common/login.html

@@ -249,67 +249,66 @@ function afterLoginSkip(data,flag){
 </script>
 <!-- 登录弹出框 -->
 <div class="modal fade b-modal" id="loginModal" tabindex="-1" role="dialog" aria-labelledby="loginModal" aria-hidden="true">
-  <div class="modal-dialog loginModal">
+  	<div class="modal-dialog loginModal">
 		<!--登录注册框-->
-    <div class="modal-content" style="height: 360px;">
+    	<div class="modal-content" style="height: 360px;">
 			<!--注册/登录框 -->
-      <div class="modal-header text-center">
-		<img alt="" src="/images/logo-white.png" class="login-logo">
-		<span data-dismiss="modal" aria-label="Close" class="close glyphicon guanbi1" onclick="clearInterval(t);"></span>
-      </div>
-	 		<div class="modal-body f-logintip1" style="display:none;padding: 20px 10px 20px 10px;">
-				 	<div style='margin-bottom:20px;'>
-						<div>
+	      	<div class="modal-header text-center">
+				<img alt="" src="/images/logo-white.png" class="login-logo">
+				<span data-dismiss="modal" aria-label="Close" class="close glyphicon guanbi1" onclick="clearInterval(t);"></span>
+	      	</div>
+		 	<div class="modal-body f-logintip1" style="display:none;padding: 20px 10px 20px 10px;">
+			 	<div style='margin-bottom:20px;'>
+					<div>
 						<div class="u-tipsok">
-								<h3>
-									<div class="f-username" style="float:left;"></div>
-									<div style="float:left;">恭喜你注册成功!</div>
-								</h3>
-							</div>
+							<h3>
+								<div class="f-username" style="float:left;"></div>
+								<div style="float:left;">恭喜你注册成功!</div>
+							</h3>
 						</div>
-						<div class="u-guide" style="margin-top:20px;"></div>
-						<div class="m-logintip">
-							<ul> 
-								<li>
-									●&nbsp;&nbsp;验证企业身份<a href="/member/accountset/index" class="btn btn-primary" style="width:82px;margin-left:5px;">认证</a>
-								</li>
-								<li>
-									●“剑鱼”向企业推送富有价值的信息情报等,去体验<a href="/front/swordfish" class="btn btn-primary" style="width:82px;margin-left:13px;">剑鱼</a>
-								</li>
-							</ul>
-						</div>
-						
 					</div>
+					<div class="u-guide" style="margin-top:20px;"></div>
+					<div class="m-logintip">
+						<ul> 
+							<li>
+								●&nbsp;&nbsp;验证企业身份<a href="/member/accountset/index" class="btn btn-primary" style="width:82px;margin-left:5px;">认证</a>
+							</li>
+							<li>
+								●“剑鱼”向企业推送富有价值的信息情报等,去体验<a href="/front/swordfish" class="btn btn-primary" style="width:82px;margin-left:13px;">剑鱼</a>
+							</li>
+						</ul>
+					</div>
+				</div>
 			</div>
 			<div class="modal-body f-login" style="text-align:center;padding-top:20;">
-		<div class="row">
-		<div class="login wxlogin hidden-xs col-md-5">
-			<div class="text-muted" style="margin-top:5px;font-weight: 700;color:#000;font-size: 14px;">微信扫码登录</div>
-			<img alt="加载中.." style="width:124px;height:127px;margin:20px;" id="wxPic" class="border">
-			<div class="text-muted" style="line-height: 22px;margin-top:5px;font-family: '宋体 Regular', 宋体;font-size: 12px;color: rgb(160, 160, 160);">使用微信扫描登录<br/>新用户自动注册</div>
-		</div>
-		<div class="login col-md-7" style="border-left:1px solid #F0F0F0;">
-			<div class="text-muted" style="margin-top:5px;font-weight: 700;color:#000;font-size: 14px;">邮箱/手机登录</div>
-			<form class="form-horizontal loginForm" method="post" style="width:220px;margin-left: 40px;">
-		  	<div class="form-group">
-				<div class="Validform_checktip text-primary"></div>
-			    <input name="s_name" type="text" class="form-control username" placeholder="邮箱/手机号" datatype="m|e" nullmsg="请填写邮箱/手机号" errormsg="邮箱/手机号格式错误">
-		  	</div>
-		 	<div class="form-group">
-			  	<div class="Validform_checktip text-primary"></div>
-			    <input name="s_pwd" type="password" class="form-control password" placeholder="密码" datatype="*" nullmsg="请填写密码">
-		  	</div>
-		  	<div class="form-group margin-t-20 font-size-12">
-				<!--<input type="checkbox" name="rememberMe" value="y" style="vertical-align: sub;">&nbsp;下次自动登录-->
-			  	<a class="pull-right text-primary" href="/front/findpwd">忘记密码?</a>
-		  	</div>
-		  	<div class="form-group text-center margin-t-20">
-		    	<button type="submit" class="btn btn-primary" style="background-color: #ff5a5f;width: 100%;">登录</button>
-		  	</div>
-		</form>
-		</div>
-		</div>
-	</div>
+				<div class="row">
+					<div class="login wxlogin hidden-xs col-md-5">
+						<div class="text-muted" style="margin-top:5px;font-weight: 700;color:#000;font-size: 14px;">微信扫码登录</div>
+						<img alt="加载中.." style="width:124px;height:127px;margin:20px;" id="wxPic" class="border">
+						<div class="text-muted" style="line-height: 22px;margin-top:5px;font-family: '宋体 Regular', 宋体;font-size: 12px;color: rgb(160, 160, 160);">使用微信扫描登录<br/>新用户自动注册</div>
+					</div>
+					<div class="login col-md-7" style="border-left:1px solid #F0F0F0;">
+						<form class="form-horizontal loginForm" method="post" style="width:220px;margin-left: 40px;">
+						  	<div class="text-muted" style="margin-top:5px;font-weight: 700;color:#000;font-size: 14px;">邮箱/手机登录</div>
+							<div class="form-group">
+								<div class="Validform_checktip text-primary"></div>
+							    <input name="s_name" type="text" class="form-control username" placeholder="邮箱/手机号" datatype="m|e" nullmsg="请填写邮箱/手机号" errormsg="邮箱/手机号格式错误">
+						  	</div>
+						 	<div class="form-group">
+							  	<div class="Validform_checktip text-primary"></div>
+							    <input name="s_pwd" type="password" class="form-control password" placeholder="密码" datatype="*" nullmsg="请填写密码">
+						  	</div>
+						  	<div class="form-group margin-t-20 font-size-12">
+								<!--<input type="checkbox" name="rememberMe" value="y" style="vertical-align: sub;">&nbsp;下次自动登录-->
+							  	<a class="pull-right text-primary" href="/front/findpwd">忘记密码?</a>
+						  	</div>
+						  	<div class="form-group text-center margin-t-20">
+						    	<button type="submit" class="btn btn-primary" style="background-color: #ff5a5f;width: 100%;">登录</button>
+						  	</div>
+						</form>
+					</div>
+				</div>
+			</div>
 		</div>
- </div>
+ 	</div>
 </div>

+ 16 - 15
weixin/src/config.json

@@ -20,19 +20,20 @@
 	"entAuthTip":",请按向导进行操作。第1步(共2步):请输入完整的企业名称。\n(认证过程只涉及您所在企业的公开信息。除非事先获得您的授权,企明星不会将您的个人隐私信息公开或透露给第三方机构。输入q或Q,退出认证操作。)",
 	"perAuthTip":",请按向导进行操作。第1步(共2步):请输入商家名称。\n(除非事先获得您的授权,企明星不会将您的个人隐私信息公开或透露给第三方机构。输入q或Q,退出认证操作。)",
 	"othAuthTip":",请按向导进行操作。第1步(共2步):请输入完整的组织机构名称。\n(认证过程只涉及您所在机构的公开信息。除非事先获得您的授权,企明星不会将您的个人隐私信息公开或透露给第三方机构。输入q或Q,退出认证操作。)",
-	"welcomeTip":"您已成功注册企明星!\n企明星是一个为全国企业提供专业化服务的互联网平台。\n即日起在企明星新注册的服务商家发布服务即可领取最高200元现金红包。\n请使用电脑登录网站http://www.qimingxing.info/ 点击右侧“发服务”完成以下操作即可获得红包:\n1.“实名认证”,进行企业身份认证。\n2.发布“服务信息”,让更多用户找到你。\n活动详情参看下方菜单“领取红包”。",
-	"oWelcomeTip":"您已成功注册企明星!\n企明星是一个为全国企业提供专业化服务的互联网平台。\n即日起在企明星新注册的服务商家发布服务即可领取最高200元现金红包。\n请使用电脑登录网站http://www.qimingxing.info/ 点击右侧“发服务”完成以下操作即可获得红包:\n1.“实名认证”,进行企业身份认证。\n2.发布“服务信息”,让更多用户找到你。\n活动详情参看下方菜单“领取红包”。",
-	"loginTip":"您已经成功登录企明星,请在电脑端操作。",
-	"freezeTip":"您的帐号已经冻结,请联系管理员。",
-	"messagetpl":{
-		"identifytplid":"sKn4r0or615ETYC-aI5OACPO_Q4-B8GYmgWoqcDghN4",
-		"offLinemsgtplid":"ExIeyFfoDNVJXhRDq09JbsjH_zbEJCB6gw6rxcV7atw",
-		"msgnotifytplid":"fcke7PqteAtclzHV3ScdiePH48vxaH6M5aJF0O_7by8",
-		"managernotirytplid":"dplgu5Q644vzPdqcPXY7RqgItS3eXACmU1XDl27CvTA"
-	},
-	"activity":{
-		"activitycode":"topcj",
-		"title":"新用户抽奖",
-		"picurl":"http://www.qimingxing.info/images/logo.png"
-	}
+	"oWelcomeTip":"您已成功注册企明星!\n企明星是一个为全国企业提供专业化服务的互联网平台。
+",
+        "loginTip":"您已经成功登录企明星,请在电脑端操作。",
+        "freezeTip":"您的帐号已经冻结,请联系管理员。",
+        "messagetpl":{
+                "identifytplid":"oGxkPyaV42z3KWykt58Tow9mBe_ImJvi8R3ajorVWOY",
+                "offLinemsgtplid":"ExIeyFfoDNVJXhRDq09JbsjH_zbEJCB6gw6rxcV7atw",
+                "msgnotifytplid":"b7iuAMiTCIolnPhTdueKBVYThEMf2D-Bh2M_9v3J-68",
+                "managernotifytplid":"dplgu5Q644vzPdqcPXY7RqgItS3eXACmU1XDl27CvTA"
+        },
+        "activity":{
+                "activitycode":"topcj",
+                "title":"企明星新年抽奖活动进行中",
+                "picurl":"http://www.qimingxing.info/images/choujiang.png"
+        }
+
 }

+ 1 - 1
weixin/src/qfw/weixin/msgtxtchandler.go

@@ -65,7 +65,7 @@ func MsgTxtHandler(w ResponseWriter, r *Request) {
 	} else if r.Content == "抽奖" { //进入抽奖环节
 		//查改用户是否已经抽过奖
 		if dao.FindWinningRecord(r.FromUserName, wf.SysConfig.Activity["activitycode"]) {
-			w.ReplyText("您已经参与过新用户抽奖活动,请关注我们的其他活动")
+			w.ReplyText("小主莫贪心,每人只有一次抽奖机会呦")
 		} else {
 			targeturl := fmt.Sprintf("http://%s/activity/%s/%s", wf.SysConfig.Domain, wf.SysConfig.Activity["activitycode"], se.EncodeString(r.FromUserName))
 			log.Println("choujiang url:", targeturl)