yuanyiming 1 年間 前
コミット
507562731b
1 ファイル変更78 行追加33 行削除
  1. 78 33
      pbl.js

+ 78 - 33
pbl.js

@@ -73,34 +73,34 @@ router.get("/weChatCode", async (req, res) => {
             grant_type: "authorization_code",
         },
     });
-    console.log(response.data);
+    // console.log(response.data);
     res.send(response.data.openid);
     // QMysql(req, res, "update_NewStatusById");
 });
 
-//yym登录接口
+//yym注册接口
 router.post("/login", (req, res) => {
-    // console.log(req.body);
-    let { openid } = req.body;
+    // return console.log(req.body);
+    // let { openid } = req.body;
     postmysql3(req, res, "insert_user");
-    let token = jwt.sign({
-        openid,
-    },
-        "secret", {
-        expiresIn: "10s",
-    }
-    );
+    // let token = jwt.sign({
+    //     openid,
+    // },
+    //     "secret", {
+    //     expiresIn: "10s",
+    // }
+    // );
 
-    res.send({
-        code: 200,
-        msg: "登录成功",
-        token,
-    });
+    // res.send({
+    //     code: 200,
+    //     msg: "登录成功",
+    //     token,
+    // });
 });
 
 //yym查询用户(查询是否注册过)
 router.post("/selectUser", (req, res) => {
-    console.log(req.body);
+    // console.log(req.body);
     // let { openid } = req.body;
     postmysql3(req, res, "Select_user");
     // console.log(res.end);
@@ -119,10 +119,10 @@ router.post("/insertActive", (req, res) => {
     // console.log(req.body);
     postmysql3(req, res, "insert_activity");
 
-    res.send({
-        code: 200,
-        msg: "上传成功",
-    });
+    // res.send({
+    //     code: 200,
+    //     msg: "上传成功",
+    // });
 });
 
 //yym 获取活动
@@ -133,7 +133,7 @@ router.post("/selectActivity", (req, res) => {
 
 //yym 获取用户收藏信息
 router.post("/selectColl", (req, res) => {
-    console.log(req.body); 
+    // console.log(req.body); 
     postmysql3(req, res, "select_coll");
 });
 
@@ -154,19 +154,19 @@ router.post("/updateSub", (req, res) => {
 });
 //yym 获取用户收藏数据(数组查询)  废弃
 router.post("/selectCollList", (req, res) => {
-    console.log('获取',req.body); 
+    // console.log('获取',req.body); 
     postmysql3(req, res, "select_collList");
 });
 
 //yym 获取用户订阅数据(数组查询)  废弃
 router.post("/selectSubList", (req, res) => {
-    console.log('获取',req.body); 
+    // console.log('获取',req.body); 
     postmysql3(req, res, "select_subList");
 });
 
 //yym 获取用户信息
 router.post("/selectUserInfo", (req, res) => {
-    console.log('获取',req.body); 
+    // console.log('获取',req.body); 
     postmysql3(req, res, "select_UserInfo");
 });
 
@@ -178,7 +178,7 @@ router.post("/updateUserInfo", (req, res) => {
 
 //yym 用户报名收藏等操作  0收藏 1订阅 2报名
 router.post("/insertOperator", (req, res) => {
-    console.log('获取',req.body); 
+    // console.log('获取',req.body); 
     postmysql3(req, res, "insert_operator");
 });
  
@@ -218,12 +218,57 @@ router.post("/insertSignup", (req, res) => {
     // console.log('获取',req.body); 
     postmysql3(req, res, "insert_Signup");
 });
-//yym 报名活动
-router.post("/updateView", (req, res) => {
+
+//yym 做最后判断防止同一时间进入报名页面都报名成功
+router.post("/selectIntercept", (req, res) => {
     // console.log('获取',req.body); 
-    postmysql3(req, res, "update_view");
+    postmysql3(req, res, "select_intercept");
 });
 
+//yym 获取活动报名人
+router.post("/selectApplyUser", (req, res) => {
+    // console.log('获取',req.body); 
+    postmysql3(req, res, "select_applyUser");
+});
+
+//yym 添加活动通知
+router.post("/insertMessage", (req, res) => {
+    // console.log('获取',req.body); 
+    postmysql3(req, res, "insert_message");
+});
+
+
+//yym 信息列表查询信息
+router.post("/selectMessage", (req, res) => {
+    // console.log('获取',req.body); 
+    postmysql3(req, res, "select_message");
+});
+
+//yym 查询所有未读信息
+router.post("/selectAllMessage", (req, res) => {
+    // console.log('获取',req.body); 
+    postmysql3(req, res, "select_allMessage");
+});
+
+//yym 信息页面分组查询未读信息
+router.post("/selectGroupMessage", (req, res) => {
+    // console.log('获取',req.body); 
+    postmysql3(req, res, "select_groupMessage");
+});
+
+//yym 更新未读信息
+router.post("/updateIsRead", (req, res) => {
+    console.log('获取',req.body); 
+    postmysql3(req, res, "update_isRead");
+});
+
+//yym 我的页面,我的收藏活动列表
+router.post("/selectCollAcList", (req, res) => {
+    console.log('获取',req.body); 
+    postmysql3(req, res, "select_collAcList");
+});
+
+
 
 //lqh获取活动acid
 router.post("/selectActivityID", (req, res) => {
@@ -255,9 +300,9 @@ router.post("/insertActivityEnroll", (req, res) => {
     // console.log(req.body);
     postmysql3(req, res, "insert_activity_enroll");
 
-    res.send({
-        msg: "上传成功",
-    });
+    // res.send({
+    //     msg: "上传成功",
+    // });
 
 });
 
@@ -273,7 +318,7 @@ router.post("/selectActivityEnrollid", (req, res) => {
 
 //查询全部活动
 router.route("/selectAct").all((req, res, next) => {
-    var json = queryString(req.url);
+    // var json = queryString(req.url);
     getmysql(req, res, "selectAct");
 });