feat: 路由管理
This commit is contained in:
@@ -84,6 +84,7 @@
|
||||
|
||||
<view
|
||||
class="mt-50 mx-auto w-294 bg-[linear-gradient(45deg,#3B81F3,#37E6EC)] rounded-full text-center text-14 text-white py-15 mt-15"
|
||||
@click="handleLogout"
|
||||
>
|
||||
退出登录
|
||||
</view>
|
||||
@@ -93,6 +94,17 @@
|
||||
<script lang="ts" setup>
|
||||
import Avatar from '@/components/Avatar.vue'
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import { loginRoute } from '@/interceptors/route'
|
||||
import { useUserStore } from '@/store/user'
|
||||
|
||||
const userStore = useUserStore()
|
||||
|
||||
const handleLogout = () => {
|
||||
userStore.clearUserInfo()
|
||||
uni.reLaunch({
|
||||
url: loginRoute,
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
Reference in New Issue
Block a user