From d2ba0df2b5512a406df77159eb27ff3b74497693 Mon Sep 17 00:00:00 2001 From: cbb <1055026847@qq.com> Date: Thu, 15 Jan 2026 17:57:32 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9C=80=E8=A6=81=E4=BF=AE=E6=94=B9BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages.json | 12 ++++----- pages/my-index/wallet/record.vue | 42 ++++++++++++++++++++++++++++++++ stores/user.js | 34 ++++++++++++++++---------- utils/request.js | 2 +- 4 files changed, 70 insertions(+), 20 deletions(-) diff --git a/pages.json b/pages.json index 5d29aab..ebd2ce3 100644 --- a/pages.json +++ b/pages.json @@ -1,6 +1,12 @@ { "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages + { + "path": "TUIKit/components/TUIConversation/index", + "style": { + "navigationStyle": "custom" + } + }, { "path": "pages/index/index", "style": { @@ -14,12 +20,6 @@ "navigationStyle": "custom" } }, - { - "path": "TUIKit/components/TUIConversation/index", - "style": { - "navigationStyle": "custom" - } - }, { "path": "TUIKit/components/TUIChat/index", "style": { diff --git a/pages/my-index/wallet/record.vue b/pages/my-index/wallet/record.vue index bf5fde2..fb14094 100644 --- a/pages/my-index/wallet/record.vue +++ b/pages/my-index/wallet/record.vue @@ -37,6 +37,48 @@ id: '10', state: '-', color: '#e74c3c' + }, + { + name: '发红包支出', + id: '11', + state: '-', + color: '#e74c3c' + }, + { + name: '抢红包收入', + id: '12', + state: '+', + color: '#2ecc71' + }, + { + name: '红包退回收入', + id: '13', + state: '+', + color: '#2ecc71' + }, + { + name: '直播活动冻结', + id: '14', + state: '-', + color: '#f39c12' + }, + { + name: '直播活动成功扣除', + id: '15', + state: '-', + color: '#e74c3c' + }, + { + name: '直播活动冻结退回', + id: '16', + state: '+', + color: '#2ecc71' + }, + { + name: '参与直播活动', + id: '17', + state: '-', + color: '#e74c3c' } ] : [ diff --git a/stores/user.js b/stores/user.js index ab0b842..bf11dfd 100644 --- a/stores/user.js +++ b/stores/user.js @@ -101,8 +101,6 @@ export const useUserStore = defineStore('user', () => { const clearUserInfo = async () => { const show = await showDialog('提示', '确定要退出登录吗?') if (show) { - showToast('退出登录成功', 'success') - await userLogout() await logout() } } @@ -111,18 +109,28 @@ export const useUserStore = defineStore('user', () => { * 退出登录(不带提示) */ const logout = async () => { - userInfo.value = null - clearToken() - removeUserInfoData() - removeSig() - removeFontSize() - await TUILogin.logout().then(() => { + try { + userInfo.value = null + await userLogout() + await TUILogin.logout() + await TUIChatEngine.logout() + // #ifdef APP-PLUS + await useLoginState().logout() + // #endif + clearToken() + removeUserInfoData() + removeSig() + removeFontSize() + await showToast('退出登录成功', 'success') reLaunch('/pages/login/login') - }) - await TUIChatEngine.logout() - // #ifdef APP-PLUS - await useLoginState().logout() - // #endif + } catch (error) { + clearToken() + removeUserInfoData() + removeSig() + removeFontSize() + await showToast('退出登录成功', 'success') + reLaunch('/pages/login/login') + } } /** 刷新用户信息(如用户信息被修改) */ const refreshUserInfo = async () => { diff --git a/utils/request.js b/utils/request.js index bd4e1fb..0ccc46b 100644 --- a/utils/request.js +++ b/utils/request.js @@ -107,7 +107,7 @@ const handleError = (statusCode, data) => { success: async () => { await useUserStore().logout() // 可选:跳转登录页 - uni.redirectTo({ url: '/pages/login/index' }) + // uni.redirectTo({ url: '/pages/login/index' }) console.log('登录已过期,====') }, complete: () => {