From 139342e4b891380bd03136aa8734d8a7543a23cd Mon Sep 17 00:00:00 2001 From: LGX <365820713@qq.com> Date: Sat, 24 Aug 2024 20:15:34 +0800 Subject: [PATCH] 1 --- .hbuilderx/launch.json | 4 ++ api/request.js | 31 ++++++++----- pages.json | 61 +++++++++++------------- pages/face/face.vue | 65 ++++++++++++++++++++------ pages/index/index.vue | 77 ++++++++++++++++++++++++++----- pages/login/login.vue | 24 ++++++++-- pages/mendainlist/mendainlist.vue | 15 +++--- pages/order/order.vue | 19 ++++++-- pages/user/index.vue | 20 ++++++-- pages/user/portrait/portrait.vue | 8 ++-- 10 files changed, 228 insertions(+), 96 deletions(-) diff --git a/.hbuilderx/launch.json b/.hbuilderx/launch.json index 81f13f4..ee5be77 100644 --- a/.hbuilderx/launch.json +++ b/.hbuilderx/launch.json @@ -2,6 +2,10 @@ // launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数 "version": "0.0", "configurations": [{ + "app-plus" : + { + "launchtype" : "local" + }, "default" : { "launchtype" : "local" diff --git a/api/request.js b/api/request.js index bd46084..5bf845c 100644 --- a/api/request.js +++ b/api/request.js @@ -3,6 +3,8 @@ let baseUrl = 'https://bodybuilding.bsdong.cn/'; //https://console-docs.apipost.cn/preview/077df998e6b8e954/a3d90a650bdbe292 Vue.prototype.$baseUrl = baseUrl; +// 当前是否显示modal +let loginModal = false export function request(prams) { return new Promise((resolve, reject) => { let url; @@ -19,18 +21,23 @@ export function request(prams) { if (res.data.code == 200){ resolve(res.data); }else if(res.data.code == 402){ - uni.showModal({ - title: "温馨提示", - content: "当前账号已过期,是否重新登录", - confirmColor: "#05754D", - success(res) { - uni.removeStorageSync("userInfo") - uni.removeStorageSync("token") - uni.navigateTo({ - url: "/pages/login/login" - }) - } - }) + if(!loginModal){ + loginModal = true + uni.showModal({ + title: "温馨提示", + content: "当前账号已过期,是否重新登录", + confirmColor: "#05754D", + success(res) { + uni.removeStorageSync("userInfo") + uni.removeStorageSync("token") + uni.navigateTo({ + url: "/pages/login/login" + }) + loginModal = false + } + }) + } + } else { reject(res.data); uni.showToast({ diff --git a/pages.json b/pages.json index c5a5d18..661fc0c 100644 --- a/pages.json +++ b/pages.json @@ -1,19 +1,18 @@ { - "pages": [ - { - "path": "pages/login/login", + "pages": [{ + "path": "pages/index/index", "style": { - "navigationBarTitleText": "登录", - "navigationBarBackgroundColor": "#fff", + "navigationBarTitleText": "首页", "navigationStyle": "custom" + } }, { - "path": "pages/index/index", + "path": "pages/login/login", "style": { - "navigationBarTitleText": "首页", + "navigationBarTitleText": "登录", + "navigationBarBackgroundColor": "#fff", "navigationStyle": "custom" - } }, { @@ -24,50 +23,43 @@ } }, { - "path" : "pages/user/userxy/userxy", - "style" : - { - "navigationBarTitleText" : "" + "path": "pages/user/userxy/userxy", + "style": { + "navigationBarTitleText": "" } }, { - "path" : "pages/user/portrait/portrait", - "style" : - { - "navigationBarTitleText" : "", + "path": "pages/user/portrait/portrait", + "style": { + "navigationBarTitleText": "", "navigationStyle": "custom" } }, { - "path" : "pages/mendainlist/mendainlist", - "style" : - { - "navigationBarTitleText" : "", - "navigationStyle": "custom", - "enablePullDownRefresh": true + "path": "pages/mendainlist/mendainlist", + "style": { + "navigationBarTitleText": "", + "navigationStyle": "custom" } }, { - "path" : "pages/order/order", - "style" : - { - "navigationBarTitleText" : "", + "path": "pages/order/order", + "style": { + "navigationBarTitleText": "", "navigationStyle": "custom" } }, { - "path" : "pages/face/face", - "style" : - { - "navigationBarTitleText" : "", + "path": "pages/face/face", + "style": { + "navigationBarTitleText": "", "navigationStyle": "custom" } }, { - "path" : "pages/login/auth/auth", - "style" : - { - "navigationBarTitleText" : "" + "path": "pages/login/auth/auth", + "style": { + "navigationBarTitleText": "" } } ], @@ -94,7 +86,6 @@ "navigationBarTextStyle": "#222222", "navigationBarTitleText": "uni-app", "navigationBarBackgroundColor": "#F8A617", - "backgroundColor": "#55ff00", "app-plus": { "background": "#efeff4" } diff --git a/pages/face/face.vue b/pages/face/face.vue index 97a78a4..977723e 100644 --- a/pages/face/face.vue +++ b/pages/face/face.vue @@ -1,7 +1,7 @@