Ver código fonte

Merge branch 'dev/v4.9.39_fu' of qmx/jy into feature/v4.9.39

fuwencai 1 ano atrás
pai
commit
4f86b0d857

+ 5 - 3
src/jfw/modules/app/p583.http

@@ -1,4 +1,4 @@
-GET http://127.0.0.1:89/jyapp/m/RV4=
+GET http://127.0.0.1:89/jyapp/m/RVw=
 Content-Type: application/json
 
 {}
@@ -6,8 +6,10 @@ Content-Type: application/json
 ###
 POST http://127.0.0.1:89/jyapp/checkSubscribe
 Content-Type: application/json
-Cookie: SESSIONID=1e0073c005557c42e6198e53ef6ca273449a84e0
 
-{}
+{
+  "id":"RQ=="
+
+}
 
 ###

+ 2 - 2
src/jfw/modules/app/src/active.json

@@ -12,10 +12,10 @@
   },
   "activateInfo": {
     "name": "激活活动",
-    "endTime": 1725120000,
+    "endTime": 1625120000,
     "appID": "wx37f06c38292f7d82",
     "envVersion": "trial",
-    "endUrl": "",
+    "endUrl": "https://mp.weixin.qq.com/s?__biz=Mzk0MjIyMzY2Nw==&mid=2247497288&idx=1&sn=06e3b7145af4d46d5410a340413870c6&chksm=c2c4ce14f5b34702761205555b871b96223a9f6ff4133a3654b3aa804b9024312cc43ff44fd5#rd",
     "url": "/frontRouter/activity/free/open-mini-program.html",
     "to": [
       {

+ 1 - 0
src/jfw/modules/app/src/app/filter/loginfilter.go

@@ -38,6 +38,7 @@ var urls = []*regexp.Regexp{
 	regexp.MustCompile("^/jyapp/transit/.*"),
 	regexp.MustCompile("^/jyapp/new/.*"),
 	regexp.MustCompile("^/jyapp/m/.*"),
+	regexp.MustCompile("^/jyapp/checkSubscribe$"),
 }
 
 type loginFilter struct {

+ 29 - 7
src/jfw/modules/app/src/app/front/activity.go

@@ -5,6 +5,7 @@ import (
 	"app.yhyue.com/moapp/jybase/common"
 	"app.yhyue.com/moapp/jybase/encrypt"
 	"app.yhyue.com/moapp/jybase/go-xweb/xweb"
+	"encoding/json"
 	"errors"
 	"fmt"
 	"jy/src/jfw/modules/app/src/app/config"
@@ -78,11 +79,32 @@ func (s *Activity) Mini(args string) {
 
 // CheckSubscribe 是否关注
 func (s *Activity) CheckSubscribe() {
-	userInfo := common.ObjToMap(s.Session().Get("user"))
-	if userInfo == nil || common.InterfaceToStr((*userInfo)["_id"]) == "" {
-		s.ServeJson(api.NewResult(nil, errors.New("需要登录")))
-		return
-	}
-	status := jyutil.IsSubscribe(common.InterfaceToStr((*userInfo)["_id"]))
-	s.ServeJson(api.NewResult(status, nil))
+	defer common.Catch()
+	r := func() api.Result {
+		if s.Method() != "POST" {
+			return api.Result{Data: nil, Error_msg: api.Error_msg_1005}
+		}
+		//接收参数
+		// 查询
+		if string(s.Body()) == "" {
+			return api.Result{Data: nil, Error_msg: api.Error_msg_1003}
+		}
+		param := struct {
+			Id string
+		}{}
+		//接收参数
+		err := json.Unmarshal(s.Body(), &param)
+		if err != nil || param.Id == "" {
+			return api.Result{Data: nil, Error_msg: api.Error_msg_1003}
+		}
+		auId := param.Id
+		id := common.IntAll(encrypt.SE.DecodeString(auId))
+		if id == 0 {
+			return api.Result{Data: nil, Error_msg: api.Error_msg_1003}
+		}
+		userId, _ := jyutil.GetActivateUser(id)
+		status := jyutil.IsSubscribe(common.InterfaceToStr(userId))
+		return api.Result{Data: status}
+	}()
+	s.ServeJson(r)
 }