退出登录位置修改

feasure-livedata
lld 2026-03-26 19:31:59 +08:00
parent 9e4814638f
commit cac9a78f0c
2 changed files with 21 additions and 20 deletions

View File

@ -84,6 +84,7 @@
</view>
</view>
</view>
<button class="logout" type="primary" @click="handleLogout">退</button>
</view>
</view>
@ -141,6 +142,19 @@
},
handleBuilding() {
this.$modal.showToast('模块建设中~')
},
handleLogout() {
this.$modal.confirm('确定注销并退出系统吗?').then(() => {
this.$store.dispatch('LogOut').then(() => {
// ========== MQTT ==========
// 1. App
const app = getApp()
// 2. App.vuelogoutMQTT+
app.logout()
}).finally(()=>{
this.$tab.reLaunch('/pages/index')
})
})
}
}
}
@ -220,4 +234,10 @@
/* 或者写成 border: 0 !important; */
}
}
.logout {
margin: 25rpx;
background: #4e84f2;
color: #fff;
}
</style>

View File

@ -20,13 +20,6 @@
</view>
</view>
</view>
<view class="cu-list menu">
<view class="cu-item item-box">
<view class="content text-center" @click="handleLogout">
<text class="text-black">退出登录</text>
</view>
</view>
</view>
</view>
</template>
@ -47,19 +40,7 @@
handleCleanTmp() {
this.$modal.showToast('模块建设中~')
},
handleLogout() {
this.$modal.confirm('确定注销并退出系统吗?').then(() => {
this.$store.dispatch('LogOut').then(() => {
// ========== MQTT ==========
// 1. App
const app = getApp()
// 2. App.vuelogoutMQTT+
app.logout()
}).finally(()=>{
this.$tab.reLaunch('/pages/index')
})
})
}
}
}
</script>