From 0f1a67fa54e4e1e8b1ee9e20ab4bdc82f752f7d8 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Thu, 16 May 2024 14:42:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=96=E9=9F=B3=E7=89=88=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apis/request.js | 28 ++++++++++++++++------------ pages.json | 10 +++++----- pages/index/index.vue | 15 ++++++++++++--- pages/workbench/workbench.vue | 5 +++-- 4 files changed, 36 insertions(+), 22 deletions(-) diff --git a/apis/request.js b/apis/request.js index 4031782..7141464 100644 --- a/apis/request.js +++ b/apis/request.js @@ -1,5 +1,6 @@ import config from '@/config/request' let HTTP_COUNT = 0 // loading次数 +let logouted = 0 const request = options => { HTTP_COUNT++ @@ -29,18 +30,21 @@ const request = options => { if (status === 200) { resolve(data) } else if (status == 401) { - // 登录过期 - uni.clearStorageSync() - uni.showToast({ - title: message, - icon: 'none' - }) - setTimeout(() => { - uni.navigateTo({ - url: '../login/login' - }) - }, 1500) - reject(data) + if (!logouted) { + // 登录过期 + // uni.clearStorageSync() + // uni.showToast({ + // title: message, + // icon: 'none' + // }) + // setTimeout(() => { + // uni.navigateTo({ + // url: '../login/login' + // }) + // }, 1500) + reject(data) + logouted = 1 + } } else if (status == 10028 || status == 10014) { // 用户不存在 resolve(data) } else if (!status) { diff --git a/pages.json b/pages.json index d3c116e..5d86d9b 100644 --- a/pages.json +++ b/pages.json @@ -1,18 +1,18 @@ { "pages": [ { - "path" : "pages/login/login", + "path" : "pages/index/index", "style" : { - "navigationBarTitleText": "登录", + "navigationStyle": "custom", "enablePullDownRefresh": false } }, { - "path" : "pages/index/index", + "path" : "pages/login/login", "style" : { - "navigationStyle": "custom", + "navigationBarTitleText": "登录", "enablePullDownRefresh": false } }, @@ -275,7 +275,7 @@ "current": 0, //当前激活的模式(list 的索引项) "list": [{ "name": "test", //模式名称 - "path": "pages/login/login" //启动页面,必选 + "path": "pages/index/index" //启动页面,必选 }] }, "globalStyle": { diff --git a/pages/index/index.vue b/pages/index/index.vue index 04d28c7..ab0db3b 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -112,8 +112,14 @@ onShow() { this.keyword = '' this.per = true - this.getInfo() - this.getShopCart() + // 登录了就查询团队、权限等,否则只查询产品列表 + if (uni.getStorageSync('token')) { + this.getInfo() + this.getShopCart() + } else { + this.getTags() + this.getProducts() + } }, methods: { // 初始化权限 @@ -126,7 +132,7 @@ }, // 查询当前角色权限 getAuth() { - uni.getStorageSync('token') && getUserRolesPermissionMenu({ + getUserRolesPermissionMenu({ teamId: this.list.find(e => e.teamId == this.teamId).partnerClassificationId, platformId: 4 }).then(({ permissionMenu }) => { @@ -323,6 +329,9 @@ .all { font-size: 24rpx; border-radius: 20px; + &::after { + border: none; + } } .block { margin: 20rpx 0; diff --git a/pages/workbench/workbench.vue b/pages/workbench/workbench.vue index e23d421..1ad7142 100644 --- a/pages/workbench/workbench.vue +++ b/pages/workbench/workbench.vue @@ -147,12 +147,13 @@ marketingServiceCharge: 0, projectBenefit: 0, }, - headerTop: 0 + headerTop: '8px', } }, onShow() { + // #ifdef MP-WEIXIN this.headerTop = uni.getMenuButtonBoundingClientRect().top + 8 + 'px' - console.log(44, this.headerTop) + // #endif this.per = true this.getInfo() },