This commit is contained in:
xuyue committed 2025-03-04 08:52:28 +08:00
1 parent f91b4ab856
commit 2af1109ced
8 files changed
+29 -13

No files matched your search

+3 -2
View File
@@ -4,6 +4,7 @@ import Login from "./components/Login.vue"
import { onMounted, watch } from "vue"
import { Account } from "./api"
import { authed, user } from "./store/user"
import { STORAGE_KEY } from "./utils/const"
onMounted(async () => {
const data = await Account.getMyProfile()
@@ -14,9 +15,9 @@ onMounted(async () => {
watch(authed, (v) => {
if (v) {
localStorage.setItem("web-isloggedin", "true")
localStorage.setItem(STORAGE_KEY.LOGIN, "true")
} else {
localStorage.removeItem("web-isloggedin")
localStorage.removeItem(STORAGE_KEY.LOGIN)
}
})
</script>