|
@@ -9,29 +9,30 @@ Component({
|
|
|
},
|
|
|
ready: function () {
|
|
|
if (this.data.count == 1) return;
|
|
|
- if (!wx.getStorageSync('userauth')) return;
|
|
|
- //判断页面 以免一直触发
|
|
|
- let pages = getCurrentPages();
|
|
|
- let prevPage = pages[pages.length - 1];
|
|
|
- if (prevPage.route == 'pages/login/selectSite' || prevPage.route.includes('pages/tabbar/')) {
|
|
|
- let auth = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['通用'], ['个人中心', '消息中心']);
|
|
|
- let auth2 = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['营销工具'], ['营销物料']);
|
|
|
- let list = ['首页'];
|
|
|
- auth.forEach(v => {
|
|
|
- switch (v.systemmodulename) {
|
|
|
- case "个人中心":
|
|
|
- list.push('我的')
|
|
|
- break;
|
|
|
- case "消息中心":
|
|
|
- list.push('信息')
|
|
|
- break;
|
|
|
- }
|
|
|
- })
|
|
|
- if (auth2.length == 1) list.push('营销物料');
|
|
|
- this.setData({
|
|
|
- Permission: list,
|
|
|
- auth
|
|
|
- })
|
|
|
+ if (wx.getStorageSync('userauth') != 0) {
|
|
|
+ //判断页面 以免一直触发
|
|
|
+ let pages = getCurrentPages();
|
|
|
+ let prevPage = pages[pages.length - 1];
|
|
|
+ if (prevPage.route == 'pages/login/selectSite' || prevPage.route.includes('pages/tabbar/')) {
|
|
|
+ let auth = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['通用'], ['个人中心', '消息中心']);
|
|
|
+ let auth2 = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['营销工具'], ['营销物料']);
|
|
|
+ let list = ['首页'];
|
|
|
+ auth.forEach(v => {
|
|
|
+ switch (v.systemmodulename) {
|
|
|
+ case "个人中心":
|
|
|
+ list.push('我的')
|
|
|
+ break;
|
|
|
+ case "消息中心":
|
|
|
+ list.push('信息')
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if (auth2.length == 1) list.push('营销物料');
|
|
|
+ this.setData({
|
|
|
+ Permission: list,
|
|
|
+ auth
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
},
|