提交 27350b1e 编写于 作者: D DebugIsFalse

Merge branch 'main' of gitcode.com:git_bot/ai-fe

...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
</div> </div>
</template> </template>
<script setup> <script setup>
const { $setInfo } = useUserStore() const { $signOut } = useUserStore()
const { $isSignIn, $info } = storeToRefs(useUserStore()) const { $isSignIn, $info } = storeToRefs(useUserStore())
const { $lang, $langOptions } = useI18nStore() const { $lang, $langOptions } = useI18nStore()
const colorMode = useColorMode() const colorMode = useColorMode()
...@@ -75,7 +75,10 @@ const items = [ ...@@ -75,7 +75,10 @@ const items = [
[ [
{ {
label: '退出登录', label: '退出登录',
icon: 'i-heroicons-power' icon: 'i-heroicons-power',
click: () => {
$signOut()
}
} }
] ]
] ]
......
...@@ -14,5 +14,10 @@ export const useUserStore = defineStore('user', () => { ...@@ -14,5 +14,10 @@ export const useUserStore = defineStore('user', () => {
const $isSignIn = computed(() => !!token.value) const $isSignIn = computed(() => !!token.value)
return { $info, $isSignIn } function $signOut () {
token.value = null
userInfo.value = null
}
return { $info, $isSignIn, $signOut }
}) })
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册