代码优化
This commit is contained in:
@@ -8,6 +8,7 @@ import useStore from "@/store";
|
||||
import { storeToRefs } from "pinia";
|
||||
const store = useStore();
|
||||
const { user } = storeToRefs(store);
|
||||
const { updateUser } = store;
|
||||
|
||||
const toOrderPage = () => {
|
||||
uni.navigateTo({
|
||||
@@ -40,6 +41,11 @@ const toRankIntroPage = () => {
|
||||
url: "/pages/rank-intro",
|
||||
});
|
||||
};
|
||||
const logout = () => {
|
||||
uni.removeStorageSync("token");
|
||||
uni.navigateBack();
|
||||
updateUser();
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -78,6 +84,7 @@ const toRankIntroPage = () => {
|
||||
<view class="my-grow" @click="toMyGrowthPage">
|
||||
<image src="../static/my-grow.png" mode="widthFix" />
|
||||
</view>
|
||||
<UserItem title="退出登录(仅用于测试)" :onClick="logout" />
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user