mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp.git
synced 2026-09-20 11:52:02 +08:00
feat(distribution): 重构招募页登录态同步
- 将 `isUserLoggedIn` 从计算属性改为响应式变量,便于主动刷新登录状态。 - 新增 `syncLoginState`,在页面加载时按 access token 同步登录态,避免登录后条件与申请入口不同步。
This commit is contained in:
@@ -206,7 +206,7 @@ const formInfoCompleted = ref(false)
|
|||||||
const fieldErrors = reactive<Record<string, string>>({})
|
const fieldErrors = reactive<Record<string, string>>({})
|
||||||
const inviterInfo = ref<any>(null)
|
const inviterInfo = ref<any>(null)
|
||||||
|
|
||||||
const isUserLoggedIn = computed(() => !!storage.getAccessToken())
|
const isUserLoggedIn = ref(!!storage.getAccessToken())
|
||||||
|
|
||||||
const plan = computed(() => pageInfo.value.plan || null)
|
const plan = computed(() => pageInfo.value.plan || null)
|
||||||
const fields = computed(() => pageInfo.value.fields || [])
|
const fields = computed(() => pageInfo.value.fields || [])
|
||||||
@@ -360,7 +360,12 @@ onShow(() => {
|
|||||||
loadPageData()
|
loadPageData()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
function syncLoginState() {
|
||||||
|
isUserLoggedIn.value = !!storage.getAccessToken()
|
||||||
|
}
|
||||||
|
|
||||||
function loadPageData() {
|
function loadPageData() {
|
||||||
|
syncLoginState()
|
||||||
loading.value = true
|
loading.value = true
|
||||||
applySubmitted.value = false
|
applySubmitted.value = false
|
||||||
submitAuditMode.value = ''
|
submitAuditMode.value = ''
|
||||||
|
|||||||
Reference in New Issue
Block a user