Преглед изворни кода

应用消息跳转前校验

zhaoxiaohai пре 2 година
родитељ
комит
14d3c018a4
1 измењених фајлова са 16 додато и 2 уклоњено
  1. 16 2
      pages/tabbar/message/details.js

+ 16 - 2
pages/tabbar/message/details.js

@@ -20,12 +20,26 @@ Page({
             })
         })
     },
-    toDetails() {
+    async toDetails() {
         const {
             objectname,
             objectid
         } = this.data.detailsData;
-        console.log(objectname, objectid)
+
+        const res = await _Http.basic({
+            "classname": "saletool.common.auth",
+            "method": "isAuth",
+            "content": {
+                objectid,
+                objectname
+            }
+        });
+
+        if (res.msg != '成功' || res.data[0].isAuth != 1) return wx.showToast({
+            title: '暂无权限进入应用',
+            icon: "none"
+        });
+
         switch (objectname) {
             case 'sat_courseware':
                 wx.navigateTo({