This commit is contained in:
owenchen committed 2026-10-13 17:02:14 +08:00
1 parent 32f237c4bf
commit 8a2adb0a92
18 files changed
+418 -53

No files matched your search

@@ -32,7 +32,7 @@ useAuthGuard(() => {
</script>
<template>
<app-page :nav-title="WebSitePolicy.Title" :show-nav-back="false" :hide-nav="true">
<app-page :nav-title="WebSitePolicy.Title" :show-nav-back="false" :hide-nav="true" :show-tabbar="true">
<view class="dashboard">
<view v-if="menu.loading.value" class="dashboard__tip">
<text>{{ t("AdminPage.menuLoading") }}</text>
+15 -2
View File
@@ -4,10 +4,10 @@
// 加密已抽到 @/common/pwd-crypto(wxmp-rsa 纯 JS 实现,H5/小程序/App 全端可用)
import type { LoginData } from "@/data/auto/loginData";
import type { LoginProfile } from "@/data/auto/loginProfile";
import { onLoad } from "@dcloudio/uni-app";
import { onLoad, onShow } from "@dcloudio/uni-app";
import { useLocale } from "uview-pro";
import { computed, ref } from "vue";
import { backendLocale, baseUrl } from "@/common/http.interceptor";
import { backendLocale, baseUrl, hasLoginSession } from "@/common/http.interceptor";
import { encryptLoginPassword } from "@/common/pwd-crypto";
import { LoginData as LoginDataClass } from "@/data/auto/loginData";
import { reloadLocales } from "@/locale";
@@ -35,6 +35,19 @@ onLoad((options) => {
}
});
/**
* 冷启动直接落在登录入口且本地已有登录会话 → 自动进 dashboard,
* 省掉"明明登录过还闪一下登录页"。令牌若已过期,dashboard 首个请求会触发请求层用
* RefreshToken 自动续期;续期失败再 goLogin 退回本页,不会卡在受保护页里。
* 被"有意送回登录页"的场景(401 去登录 / 403 重新登录)不必再设豁免:
* goLoginWithRedirect 已先清登录态,此刻 hasLoginSession 必为假,表单正常展示。
*/
onShow(() => {
if (hasLoginSession()) {
uni.reLaunch({ url: redirectUrl.value });
}
});
// 登录页中英文切换:走 uView Pro 语言包(t / setLocale),语言包 name 为 zh-CN / en-US
const { t, setLocale, currentLocale } = useLocale();
const isZh = computed(() => (currentLocale.value?.name ?? "zh-CN") !== "en-US");
@@ -164,12 +164,9 @@ useAuthGuard(() => {
:filter-items="draft" :search-token="searchToken" @search="onSearch" @open-filter="state.openFilter()"
@close-filter="state.closeFilter()" @apply-filter="state.applyFilter($event)"
@clear-filter="state.clearFiltersAndSearch()" @row-tap="onRowTap">
<template #toolbar>
<template #toolbar-actions>
<view v-if="perm.canCreate.value" class="create-entry" @click="onCreate">
<u-icon name="plus" size="24" color="#ffffff" />
<text class="create-text">
{{ t("AdminPage.createBut") }}
</text>
<u-icon name="plus" size="40" />
</view>
</template>
@@ -188,21 +185,17 @@ useAuthGuard(() => {
background-color: $u-bg-color;
}
/* 新增:翠绿实心胶囊,靠右落在次级工具行里 */
/* 新增:与筛选按钮同一行的方形图标钮,只留一个加号 */
.create-entry {
display: flex;
flex-direction: row;
align-items: center;
padding: 12rpx 28rpx;
color: #ffffff;
background-color: $u-type-primary;
border-radius: 999rpx;
box-shadow: 0 6rpx 16rpx rgba(5, 150, 105, 0.24);
}
.create-text {
margin-left: 8rpx;
font-size: 26rpx;
font-weight: 500;
justify-content: center;
width: 64rpx;
height: 64rpx;
margin-left: 12rpx;
color: $u-type-primary;
background-color: $u-bg-color;
border-radius: 16rpx;
}
</style>
+44
View File
@@ -0,0 +1,44 @@
<script setup lang="ts">
/**
* 底部导航「文件」测试页:先占位,后续接相册/文件功能。
* 权限暂用 UserOperation(见 routes.ts 的 PAGE_PERMISSIONS);nav-guard 在 reLaunch 时做路由级校验,
* 这里再挂一次 useAuthGuard 兜冷启动直达(地址栏 / file、分享链接不经过导航 API)。
*/
import { useAuthGuard } from "@/composables";
useAuthGuard();
</script>
<template>
<app-page nav-title="文件" :show-nav-back="false" :show-tabbar="true">
<view class="tab-page">
<text class="tab-page__title">
文件
</text>
<text class="tab-page__hint">
测试页,功能待接入
</text>
</view>
</app-page>
</template>
<style lang="scss" scoped>
.tab-page {
display: flex;
flex-direction: column;
align-items: center;
padding: 120rpx 40rpx;
}
.tab-page__title {
font-size: 40rpx;
font-weight: 600;
color: $u-main-color;
}
.tab-page__hint {
margin-top: 16rpx;
font-size: 26rpx;
color: $u-tips-color;
}
</style>
+43
View File
@@ -0,0 +1,43 @@
<script setup lang="ts">
/**
* 底部导航「多媒体」测试页:先占位,后续接照片/视频/音频。
* 权限暂用 UserOperation(见 routes.ts 的 PAGE_PERMISSIONS);useAuthGuard 兜冷启动直达。
*/
import { useAuthGuard } from "@/composables";
useAuthGuard();
</script>
<template>
<app-page nav-title="多媒体" :show-nav-back="false" :show-tabbar="true">
<view class="tab-page">
<text class="tab-page__title">
多媒体
</text>
<text class="tab-page__hint">
测试页,功能待接入
</text>
</view>
</app-page>
</template>
<style lang="scss" scoped>
.tab-page {
display: flex;
flex-direction: column;
align-items: center;
padding: 120rpx 40rpx;
}
.tab-page__title {
font-size: 40rpx;
font-weight: 600;
color: $u-main-color;
}
.tab-page__hint {
margin-top: 16rpx;
font-size: 26rpx;
color: $u-tips-color;
}
</style>
+43
View File
@@ -0,0 +1,43 @@
<script setup lang="ts">
/**
* 底部导航「我的」测试页:先占位,后续接个人资料/设置/关于入口。
* 权限暂用 UserOperation(见 routes.ts 的 PAGE_PERMISSIONS);useAuthGuard 兜冷启动直达。
*/
import { useAuthGuard } from "@/composables";
useAuthGuard();
</script>
<template>
<app-page nav-title="我的" :show-nav-back="false" :show-tabbar="true">
<view class="tab-page">
<text class="tab-page__title">
我的
</text>
<text class="tab-page__hint">
测试页,功能待接入
</text>
</view>
</app-page>
</template>
<style lang="scss" scoped>
.tab-page {
display: flex;
flex-direction: column;
align-items: center;
padding: 120rpx 40rpx;
}
.tab-page__title {
font-size: 40rpx;
font-weight: 600;
color: $u-main-color;
}
.tab-page__hint {
margin-top: 16rpx;
font-size: 26rpx;
color: $u-tips-color;
}
</style>
+43
View File
@@ -0,0 +1,43 @@
<script setup lang="ts">
/**
* 底部导航「共享」测试页:先占位,后续接家庭组/共享管理。
* 权限暂用 UserOperation(见 routes.ts 的 PAGE_PERMISSIONS);useAuthGuard 兜冷启动直达。
*/
import { useAuthGuard } from "@/composables";
useAuthGuard();
</script>
<template>
<app-page nav-title="共享" :show-nav-back="false" :show-tabbar="true">
<view class="tab-page">
<text class="tab-page__title">
共享
</text>
<text class="tab-page__hint">
测试页,功能待接入
</text>
</view>
</app-page>
</template>
<style lang="scss" scoped>
.tab-page {
display: flex;
flex-direction: column;
align-items: center;
padding: 120rpx 40rpx;
}
.tab-page__title {
font-size: 40rpx;
font-weight: 600;
color: $u-main-color;
}
.tab-page__hint {
margin-top: 16rpx;
font-size: 26rpx;
color: $u-tips-color;
}
</style>