Browse Source

提报权限修改

xiaohaizhao 2 years ago
parent
commit
4c7e3fa353
1 changed files with 7 additions and 9 deletions
  1. 7 9
      pages/submission/index.js

+ 7 - 9
pages/submission/index.js

@@ -47,15 +47,13 @@ Page({
         },
     },
     onLoad(options) {
-        let auth = options.auth ? JSON.parse(options.auth) : getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['营销工具'], ['提报'])[0].apps;
-        if (auth.length == 1) {
-            let title = auth[0].meta.title;
-            this.setData({
-                tabShow: false,
-                activeIndex: title == '一事一报' ? 0 : 1,
-                "content.onceonly": title == '一事一报' ? 1 : 0
-            })
-        }
+        let auth = wx.getStorageSync('authList').wsubmitedit.optionnames
+        let isOnce = auth.some(v => v == '一事一报');
+        this.setData({
+            tabShow: false,
+            activeIndex: isOnce ? 0 : 1,
+            "content.onceonly": isOnce ? 1 : 0
+        })
         this.getList();
     },
     getList(init = false) {