This commit is contained in:
hero920103 committed 2026-11-03 11:13:59 +08:00
1 parent 012f8edf8b
commit 36ff960fbd
33 files changed
+1644 -344

No files matched your search

+5 -3
View File
@@ -69,6 +69,7 @@ import { onShow } from '@dcloudio/uni-app'
import { fetchNotes, deleteNote, toggleNotePin } from '@/api/note.js'
import { formatRelativeTime } from '@/utils/date.js'
import { isLoggedIn } from '@/utils/auth.js'
import { getGuestToken } from '@/utils/guest.js'
const keyword = ref('')
const notes = ref([])
@@ -78,15 +79,16 @@ const loading = ref(false)
const pinnedCount = computed(() => notes.value.filter(item => item.pinned).length)
onMounted(() => {
if (!isLoggedIn()) {
uni.reLaunch({ url: '/pages/login/login' })
// 免登录页面:登录态或游客令牌均可用;两者皆无回门户触发授权/登录
if (!isLoggedIn() && !getGuestToken()) {
uni.reLaunch({ url: '/pages/nav/nav' })
return
}
loadNotes()
})
onShow(() => {
if (isLoggedIn()) loadNotes()
if (isLoggedIn() || getGuestToken()) loadNotes()
})
async function loadNotes() {