|
@@ -46,7 +46,20 @@ func MsgTxtHandler(w ResponseWriter, r *Request) {
|
|
|
openid := r.FromUserName
|
|
|
//log.Println("........", r.FromUserName, r.Content)
|
|
|
//在会话中
|
|
|
- if us, ok := UserSession[openid]; ok {
|
|
|
+ if r.Content == "开始识别验证码" { //进入人工识别验证码工作
|
|
|
+ w.PostText(wf.SysConfig.DistinguishWork["in"].(string))
|
|
|
+ time.AfterFunc(2*time.Second, func() {
|
|
|
+ distinguishWork.Start(openid)
|
|
|
+ })
|
|
|
+ } else if distinguishWork.IsWorking(openid) { //人工识别验证码工作中。。。
|
|
|
+ if r.Content == "结束识别验证码" {
|
|
|
+ w.ReplyText(wf.SysConfig.DistinguishWork["out"].(string))
|
|
|
+ distinguishWork.End(openid)
|
|
|
+ } else if distinguishWork.IsWaitReply(openid) {
|
|
|
+ w.PostText(wf.SysConfig.DistinguishWork["reply"].(string))
|
|
|
+ distinguishWork.Reply(openid, r.Content)
|
|
|
+ }
|
|
|
+ } else if us, ok := UserSession[openid]; ok {
|
|
|
if r.Content == "q" || r.Content == "Q" {
|
|
|
if us.Type == "faq" {
|
|
|
w.ReplyText("您已经退出智能咨询服务。")
|
|
@@ -107,21 +120,6 @@ func MsgTxtHandler(w ResponseWriter, r *Request) {
|
|
|
PicUrl: wf.SysConfig.Qmxcdn + "/images/swordfish/jianyu_weixin.jpg",
|
|
|
Url: "http://mp.weixin.qq.com/s?__biz=MzA5MTk0MTk5Ng==&mid=406103124&idx=1&sn=c12f1cc34899f0c3b36492885567315a#rd",
|
|
|
}})
|
|
|
- } else if r.Content == "开始识别验证码" { //进入人工识别验证码工作
|
|
|
- w.ReplyText(wf.SysConfig.DistinguishWork["in"].(string))
|
|
|
- time.AfterFunc(2*time.Second, func() {
|
|
|
- distinguishWork.Start(openid)
|
|
|
- })
|
|
|
- } else if distinguishWork.IsWorking(openid) { //人工识别验证码工作中。。。
|
|
|
- if r.Content == "结束识别验证码" {
|
|
|
- w.ReplyText(wf.SysConfig.DistinguishWork["out"].(string))
|
|
|
- distinguishWork.End(openid)
|
|
|
- } else if distinguishWork.IsWaitReply(openid) {
|
|
|
- w.PostText(wf.SysConfig.DistinguishWork["reply"].(string))
|
|
|
- time.AfterFunc(1*time.Second, func() {
|
|
|
- distinguishWork.Reply(openid, r.Content)
|
|
|
- })
|
|
|
- }
|
|
|
} else {
|
|
|
now := time.Now()
|
|
|
if now.Weekday() == 6 || now.Weekday() == 0 || (now.Hour() > 17 || now.Hour() < 9) {
|