2026-09-25 18:00:10 +08:00

71 lines
1.8 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<view class="page">
<view class="card">
<up-cell-group :border="false">
<up-cell title="登录状态" :value="isLogin ? '已登录' : '未登录'" :border="false"></up-cell>
<up-cell title="页面策略" value="public(无需登录)" :border="false"></up-cell>
</up-cell-group>
</view>
<view class="card">
<view class="card__title">这页验证什么</view>
<view class="text">
它在 PAGE_REGISTRY 里声明为 auth: 'public' 且
<text class="text--strong">common: true</text>,因此会出现在首页
<text class="text--strong">「常用功能」段</text>里(LOCAL_COMMON_ENTRIES),**未登录也能看到**。
</view>
<view class="text">
这正是「未登录也必须有可浏览内容」这条微信审核要求的落点:
「常用功能」由前端本地清单决定,不依赖后端菜单是否配置。
</view>
</view>
</view>
</template>
<script setup lang="ts">
/**
* 框架示例页:`public`(公共页面)
*
* ⚠️ 这是「页面渲染框架」的示例页,业务页上线后可直接删除
* (删除时同步清理:pages.json 的 subPackages、PAGE_REGISTRY、condition)。
*/
import { usePageAuth } from '@/composables/usePageAuth'
const { isLogin } = usePageAuth('public')
</script>
<style lang="scss" scoped>
.page {
min-height: 100vh;
background-color: #f5f6fa;
padding-top: 24rpx;
}
.card {
margin: 0 24rpx 24rpx;
padding: 8rpx 0;
background-color: #ffffff;
border-radius: 16rpx;
overflow: hidden;
&__title {
padding: 24rpx 32rpx 8rpx;
font-size: 30rpx;
font-weight: 600;
color: #303133;
}
}
.text {
padding: 8rpx 32rpx 16rpx;
font-size: 26rpx;
line-height: 1.7;
color: #606266;
&--strong {
color: #2979ff;
font-weight: 600;
}
}
</style>