From 8588fe30f17d0d28190a279aab8675de0dbf1a5b Mon Sep 17 00:00:00 2001
From: lxf <1371462558@qq.com>
Date: Wed, 16 Jul 2025 18:46:29 +0800
Subject: [PATCH] 个人添加图片

---
 src/views/my/newindex.vue |   25 ++++++++++++++++++-------
 1 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/src/views/my/newindex.vue b/src/views/my/newindex.vue
index 94baed5..bdadfab 100644
--- a/src/views/my/newindex.vue
+++ b/src/views/my/newindex.vue
@@ -41,7 +41,7 @@
       <div class="mt-15 p-15 rounded-15 bg-#f5f7f9">
         <div v-for="(item, index) in helpItems" :key="index" class="flex items-center justify-between text-16"
           :class="{ 'mt-15': index > 0 }" @click="onRoute(item.path)">
-          <div v-if="item.button" class="flex items-center" @click="loginOut">
+          <div v-if="item.button" class="flex items-center" @click.stop="loginOut">
             <img :src="`${item.icon}`" class="w-20 h-20">
             <div class="ml-10">{{ item.title }}</div>
           </div>
@@ -67,7 +67,7 @@
 import { useUserStore } from '@/store/user';
 import { useI18n } from "vue-i18n";
 import useClipboard from "vue-clipboard3";
-import { showToast } from "vant";
+import { showConfirmDialog } from 'vant';
 import addBankIcon from '@/assets/image/userCenter/addBank.png'
 import kycHighStatusIcon from '@/assets/image/userCenter/kycHighStatus.png'
 import store from '@/store/store'
@@ -196,11 +196,22 @@
 
 })
 const loginOut = () => {
-  _logOut({
-    token: userStore.userInfo.token
-  }).then(res => {
-    userStore.userInfo = {}
-    store.state.user.userInfo = {}
+  showConfirmDialog({
+    title: `${t('确认退出')}`,
+    message: `${t('确定要退出登录吗?')}`
+  }).then(() => {
+    _logOut({
+      token: userStore.userInfo.token
+    }).then(res => {
+      userStore.userInfo = {}
+      store.state.user.userInfo = {}
+      router.push('/login')
+    })
+      .catch(err => {
+        // showFailToast(`${t('退出失败,请重试')}`)
+      })
+  }).catch(() => {
+    // 用户取消操作
   })
 }
 const getIdentify = () => {

--
Gitblit v1.9.3