From 0107d03b1270871b6c791080a23da93a227da4d2 Mon Sep 17 00:00:00 2001
From: chenyc <501753378@qq.com>
Date: 星期五, 21 十月 2022 16:26:01 +0800
Subject: [PATCH] 454

---
 src/views/login/index.vue  |    8 ++++----
 src/views/myMine/index.vue |   11 ++++++++++-
 2 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/src/views/login/index.vue b/src/views/login/index.vue
index f30bd9c..baadcce 100644
--- a/src/views/login/index.vue
+++ b/src/views/login/index.vue
@@ -51,7 +51,7 @@
             } else {
                 console.log('得到tokeng')
                 Session.set('token', re)
-                Toast('登录成功。。。。。')
+                Toast('登录成功')
                 getUserinfo()
             }
         }).finally(()=>{
@@ -81,7 +81,7 @@
                 Toast('登录失败,请重新登录')
             } else {
                 Session.set('token', re)
-                Toast('登录成功。。。。。')
+                Toast('登录成功')
                 getUserinfo()
             }
         })
@@ -136,10 +136,10 @@
                         ajaxPost('patient/info/wechatLogin','openId='+openId,config).then((re:any)=>{
                             console.log('openid换的accesstoken=',re)
                             if (re===''){
-                                Toast('请填写表单登录。。')
+                                Toast('请填写表单登录')
                             } else {
                                 Session.set('token', re)
-                                Toast('登录成功。。。。。')
+                                Toast('登录成功')
                                 getUserinfo()
                             }
                         })
diff --git a/src/views/myMine/index.vue b/src/views/myMine/index.vue
index b04b713..78830ed 100644
--- a/src/views/myMine/index.vue
+++ b/src/views/myMine/index.vue
@@ -101,7 +101,7 @@
             </div>
         </div>
         <div class="ButtonBody">
-            <van-button type="primary" round block>退出登录</van-button>
+            <van-button type="primary" @click="logOUT" round block>退出登录</van-button>
         </div>
         <van-tabbar v-model="active" @change="tabChang">
             <van-tabbar-item name="home" icon="like">首页</van-tabbar-item>
@@ -111,6 +111,8 @@
 </template>
 <script lang="ts" setup>
     import { ref,computed } from 'vue'
+    import {ajaxPost} from '@/utils/axios'
+    import { Session } from '@/utils/storage'
     import { userInfoStore } from '@/stores/userInfo'
     import serve1 from './imgs/serve1.png'
     import { Image as VanImage,Tabbar as VanTabbar , TabbarItem as VanTabbarItem} from 'vant'
@@ -128,6 +130,13 @@
     const patientInfo=computed(()=>{
         return userInfo.patient
     })
+    const logOUT=()=>{
+        ajaxPost('/patient/info/logout','').then((re:any)=>{
+            console.log(re)
+            Session.clear() // 清除缓存/token等
+            router.push('login')
+        })
+    }
 </script>
 <style lang="scss" scoped>
     body{

--
Gitblit v1.8.0