🐛 Bug fixes on undefined cookies
This commit is contained in:
		@@ -26,7 +26,7 @@
 | 
			
		||||
import { useUserinfo } from "@/stores/userinfo"
 | 
			
		||||
import { computed } from "vue"
 | 
			
		||||
 | 
			
		||||
const {t} = useI18n()
 | 
			
		||||
const { t } = useI18n()
 | 
			
		||||
const config = useRuntimeConfig()
 | 
			
		||||
 | 
			
		||||
const id = useUserinfo()
 | 
			
		||||
@@ -50,9 +50,9 @@ const avatar = computed(() => {
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
function signOut() {
 | 
			
		||||
  useCookie("__hydrogen_atk", { watch: "shallow" }).value = null
 | 
			
		||||
  useCookie("__hydrogen_rtk", { watch: "shallow" }).value = null
 | 
			
		||||
  id.userinfo = null
 | 
			
		||||
  useAtk().value = null
 | 
			
		||||
  useRtk().value = null
 | 
			
		||||
  id.userinfo.value = null
 | 
			
		||||
  reloadNuxtApp()
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
 
 | 
			
		||||
@@ -3,11 +3,11 @@ import { ref } from "vue"
 | 
			
		||||
import { solarFetch } from "~/utils/request"
 | 
			
		||||
 | 
			
		||||
export function useAtk() {
 | 
			
		||||
  return useCookie("__hydrogen_atk", { watch: "shallow", maxAge: 31556952000 })
 | 
			
		||||
  return useCookie("__hydrogen_atk", { path: "/", maxAge: 31556952000 })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function useRtk() {
 | 
			
		||||
  return useCookie("__hydrogen_rtk", { watch: "shallow", maxAge: 31556952000 })
 | 
			
		||||
  return useCookie("__hydrogen_rtk", { path: "/", maxAge: 31556952000 })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function useLoggedInState() {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user