更新
This commit is contained in:
1 parent
012f8edf8b
commit
36ff960fbd
33 files changed
+1644
-344
No files matched your search
@@ -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() {
|
||||
|
||||
@@ -115,6 +115,7 @@ import { onShow } from '@dcloudio/uni-app'
|
||||
import { fetchSchedules, getRemindChannelLabel, getRemindMinutesLabel } from '@/api/schedule.js'
|
||||
import { pad, startOfDay, isToday } from '@/utils/date.js'
|
||||
import { isLoggedIn } from '@/utils/auth.js'
|
||||
import { getGuestToken } from '@/utils/guest.js'
|
||||
|
||||
/** 周一为一周第一天 */
|
||||
const WEEK_LABELS = ['一', '二', '三', '四', '五', '六', '日']
|
||||
@@ -282,8 +283,9 @@ function openCreate() {
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
if (!isLoggedIn()) {
|
||||
uni.reLaunch({ url: '/pages/login/login' })
|
||||
// 免登录页面:登录态或游客令牌均可用;两者皆无回门户触发授权/登录
|
||||
if (!isLoggedIn() && !getGuestToken()) {
|
||||
uni.reLaunch({ url: '/pages/nav/nav' })
|
||||
return
|
||||
}
|
||||
loadReminders()
|
||||
@@ -291,8 +293,7 @@ onMounted(() => {
|
||||
|
||||
// 新增/编辑返回后刷新列表
|
||||
onShow(() => {
|
||||
if (!isLoggedIn()) return
|
||||
if (schedules.value.length || !loading.value) loadReminders()
|
||||
if (isLoggedIn() || getGuestToken()) loadReminders()
|
||||
})
|
||||
|
||||
async function loadReminders() {
|
||||
|
||||
Reference in new issue
Block a user