优化uniapp

This commit is contained in:
hero920103 committed 2026-11-11 16:58:30 +08:00
1 parent 4f1acaa451
commit 8fc52c574f
49 files changed
+1952 -197

No files matched your search

+30
View File
@@ -0,0 +1,30 @@
/**
* 授权手机号 / 注册完成后,自动继续进入用户刚才点击的模块卡片。
* 只存最小字段,避免把响应式对象或函数写进 storage。
*/
const PENDING_KEY = 'app_pending_card'
export function setPendingCard(card) {
if (!card) {
uni.removeStorageSync(PENDING_KEY)
return
}
uni.setStorageSync(PENDING_KEY, {
code: card.code || '',
name: card.name || '',
path: card.path || '',
needTenant: !!card.needTenant,
locked: !!card.locked,
items: (card.items || []).map((m) => ({
title: m.title || '',
path: m.path || '',
leaf: m.leaf !== false
}))
})
}
export function takePendingCard() {
const card = uni.getStorageSync(PENDING_KEY) || null
uni.removeStorageSync(PENDING_KEY)
return card
}